← All problemsSign in

Mathology

CodeChefRating 2682Open on judge ↗

After solving some Number Theory related problems KBG challenged VD to solve following problem. You are given an array $A$ consisting of $N$ positive integers and $Q$ queries. Each query is of the form: - $L$ $R$: Given two integers $L$ and $R$ $(1 \leq L < R \leq N)$, let $B$ denote the subarray $A[L, R]$. Find the **maximum** possible [GCD](https://en.wikipedia.org/wiki/Greatest_common_divisor)

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start