Link of the Question
http://www.spoj.com/problems/ROOTCIPH/
Purely mathematical question.........based on our algebraic knowledge.
Here
In question given that roots of the cubical polynomial
x3 +
ax2 +
bx +
c are the coordinates of the aircraft relative to the radar.
and we have to find the square of the distance to the enemy aircraft.so simply go for the solution as......square of the distance=(a*a-2*b);
Apply this in the test case given you'll find the output correctly !!
One more thing use scanf and printf instead of cin cout.