← All problemsSign in

Bet For Fans

Chef and Suraj are going to race. To make the race interesting, Chef have a bet $x$ rupees and Suraj has bet $y$ rupees. But fans seems to be disappointed. The excitement of fans is given by $gcd(x,y)$, where $gcd(x,y)$ denotes the greatest common divisor (GCD) of integers x and y. To make the race more exciting, Chef can perform two types of operations: - Increase both $x$ and $y$ by $1$. - Decre

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