My algo is to check that: 1) all spins done in same side 2) all sides are equal 3) all angles are equal 4) in any comparsions precision equals 0.000001 (I tried many variants of precision but got WA12 in any case)
It's hard for me to find tests in this problem :( What the hell is 12 test?
I think that statement need an additional guarantee like
"It is guaranteed that in the case of the positive answer the coordinates of the points can be changed by less than 10^(−10) [or another magic constant from jury solution] so that they become the coordinates of vertices of a regular n-gon written in the traversal order"
By the way, maybe my algo is wrong? I calculated the distances between i-th and (i+1)-th poitns and the distances between i-th and ((i+n/2) mod n)-th points if n is even or between i-th and a middle of segment, which is constructed by ((i+(n-1)/2) mod n)-th and ((i+(n+1)/2) mod n)-th points if n is odd. If these distances are equal, then "YES"
Oh! You are right, my program outputs "YES" on some special tests, but the answer should be always "NO"! Thank you!
Now I've got AC. Simple algo with checking if points lie on a circumference and Point[i].x = x0 + R*cos(a0 + 2*k*PI/n), Point[i].y = y0 + R*sin(a0 + 2*k*PI/n) is true for sure. I just wanted to implement my "exotic" algo there :)))) But it was wrong...
I think that most Ac are by the chance, varing eps. If impossible to solve from the fist submission the problem is incorrect. I think right uderstanding the problem is following: Let P=<P1,...,Pn>-given n-polygon and r(P)=min(max dist(Pi-Qi),on all ideal n-polygons Q=<Q1,...,Qn>) if(r(P)<=1.e-5) YES else NO. That is optimization problem.
P.S. I glad to say that under above consideration I got AC immidiately, while using chaotic eps-using had 12 WA 18.