Jon and Mathematics(Medium)
CodeChefOpen on judge ↗
Jon is trying to figure out a way so that he can be good at mathematics. He doesn’t know how to calculate the GCD of numbers. So he asks Arya to help him with GCD problems. Jon has a list $J$ of number indexed from $1$ to $N$. He wants to create another list $A$ consisting of $N+1$ numbers indexed from $1$ to $N+1$. The elements of list A must follow the property - GCD of the $A[i]$ and $A[i+1]$
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