Find an integer
Chef has two nephews who love integers $X$ and $Y$. An integer $N$ is *awesome* if the following conditions hold: - $1 \leq N \leq 10^{18}$ - $(N+Y)$ is divisible by $X$. - $(N+X)$ is divisible by $Y$. Find **any** awesome integer $N$. We can prove that under the given constraints, an answer always exists. Note that you do **not** have to minimize the answer. ### Input - The first line of input
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