Chef and Squares
CodeChefOpen on judge ↗
Chef started solving a lot of mathematics problems during the lockdown period. He was recently trying a problem related to square numbers but couldn't solve it, so needs your help. He has a positive number $N$, he wants to find out the smallest perfect square $X$ which when added to $N$ yields another perfect square number. ###Input: - First line will contain $T$, number of testcases.
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