Unique Treat
CodeChefOpen on judge ↗
Mushak is playing with an array of numbers. You are given an array $modaks$ of size $N$. You are also given $Q$ queries. Each query provides two integers $l$ and $r$, representing a subarray from index(1-based) $l$ to $r$ (inclusive). For each query, Mushak wants to know if there exists a number x such that, when every element in the subarray modaks[l … r] is taken modulo x, the results contain
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.
Sign in to chat with the tutor and save your progress.
Sign in to start