Problem link: https://atcoder.jp/contests/abc259/tasks/abc259_b
Submission link(WA): https://atcoder.jp/contests/abc259/submissions/33131531
Submission link(AC): https://atcoder.jp/contests/abc259/submissions/33131108
The only change I have done is how I am calculating the angle. I am getting wrong answer when I use atan, however I am getting AC with atan2.
My atan usage
Use following equations,