← All problemsSign in

The Strange Function

Chef has found a strange function F on his way home. It has the form of F(x) = ax2 + bx + c√x. Here √x denotes the positive square root of x. On returning home he begins putting various values as x and sees the results. Chef likes integers, and sometimes the result turns out to be an integer, but sometimes it does not. So Chef starts thinking of the reverse operation. If Chef desires a particular

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