ROBOT problem

I have not found any kind of error in this.https://www.codechef.com/viewsolution/27938350

Thanks in advance

You were required to output the final co-ordinates , but used the abs function , so wouldn’t that print out the absolute value, whereas the co-ordinates can also be negative?

Try this testcase:
1
4 2
4123
2 3
2 4

Your code gives the wrong answer for this testcase

0.0000000 1.7320508
-1.0000000 1.7320508
this is the answer coming after removing modulas.
But still it is giving wa

1 Like

Did that too…

1 Like

The correct answer is:
-0.5000000 0.8660254
0.5000000 0.8660254

Bro can u explain why it is the correct answer
steps 2 to 4 will be performed in test case 2
step 2-(.5,.86)
step 3-(0,1.73)
step 4(-1,1.73)

1 Like

I got it…
Thanks:heart_eyes:

1 Like

This video editorial might be useful for understanding the concept behind ROBOTS problem of november’19 cook off : [Tutorial] Codechef Nov'19 Cook Off - ROBOTS - YouTube

1 Like