← All problemsSign in

Find the Modulus

CodeChefRating 2304Open on judge ↗

The jury has a secret number $N$, where $1 \le N \le 10^{18}$. You want to know this number, and you are allowed to ask the jury some queries. In each query, you give the jury a number $X$ where $0 \le X \le 2 \cdot 10^{18}$, and the jury tells you $X \mod{N}$. Please find $N$ using at most **two** queries per test case. ### Interaction Format - The first line of contains $T$ - the number of te

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