Please, give me some test! Or, may be, give some advices about this test. if you are dividing something by something, make sure to account for the case where, due to precision double,dividing of two different points gives the same result I can not make tests for which the program gives an incorrect result. Help please My program failed at WA#25 because my 'getAngle' function returned negative results instead of [0; 360),  so try to check your sorting code if your program is /tmp/a.out and the input is /tmp/in, you can use the following Python 3 script to plot your output:   from matplotlib.pyplot import * import subprocess   f = open('/tmp/in') n = int(f.readline()) p = [[int(i) for i in l.split()] for l in f] print(p) out = subprocess.run('/tmp/a.out < /tmp/in', stdout=subprocess.PIPE, shell=True).stdout.decode().strip() res = [int(s) for s in out.split('\n')[1:]] print(res) plot([v[0] for v in p],[v[1] for v in p],'ro') plot([p[i-1][0] for i in res], [p[i-1][1] for i in res],'b-') axis('equal'); grid(); show() My first AC program gets WA on this test: 6 0 0 0 2 1 1 2 2 -1 -1 -2 -2   But I corrected my code :) I had some trouble passing Test #8.   It turned out that if I used Epsilon = 1e-8 to compare the angles, it worked.   Also, here is a tricky test, with lots of points on the same line:   Input: 10 0 0 1 1 2 2 3 3 4 4 -1 -1 -2 -2 -3 -3 -4 -4 0 1   One possible solution: 10 1 2 3 4 5 10 6 7 8 9 program p1444; uses math; const   maxn=30000; var   s:array[1..maxn] of record                         x,y:longint;                       end;   num:array[1..maxn] of longint;   t,len:array[1..maxn] of double;   n,m,i,j,k:longint;   procedure readdata; var   i,j,k:longint; begin   readln(n);   for i:=1 to n do     readln(s[i].x,s[i].y); end;   procedure swap(var a,b:longint); inline; var temp:longint; begin   temp:=a; a:=b; b:=temp; end;   procedure sp(var a,b:double); inline; var temp:double; begin   temp:=a; a:=b; b:=temp; end;   procedure qsort(s,b:longint); var   i,j:longint;   tx,lenx:double; begin   if s>=b then exit;   i:=s; j:=b;   tx:=t[(i+j) shr 1]; lenx:=len[(i+j) shr 1];   repeat     while (t[j]>tx)or( (t[j]=tx)and(len[j]>lenx) ) do dec(j);     while (t[i]<tx)or( (t[i]=tx)and(len[i]<lenx) ) do inc(i);     if i<=j then       begin         swap(num[i],num[j]);         sp(t[i],t[j]);         sp(len[i],len[j]);         inc(i); dec(j);       end;   until i>=j;   qsort(s,j); qsort(i,b); end;   procedure qsort2(s,b:longint); var   i,j:longint;   tx,lenx:double; begin   if s>=b then exit;   i:=s; j:=b;   tx:=t[(i+j) shr 1]; lenx:=len[(i+j) shr 1];   repeat     while (t[j]<tx)or( (t[j]=tx)and(len[j]>lenx) ) do dec(j);     while (t[i]>tx)or( (t[i]=tx)and(len[i]<lenx) ) do inc(i);     if i<=j then       begin         swap(num[i],num[j]);         sp(t[i],t[j]);         sp(len[i],len[j]);         inc(i); dec(j);       end;   until i>=j;   qsort2(s,j); qsort2(i,b); end;   procedure solve; var   check:boolean;   i,j,k:longint; begin   for i:=2 to n do     begin       dec(s[i].x,s[1].x);       dec(s[i].y,s[1].y);     end;   s[1].x:=0; s[1].y:=0;   for i:=2 to n do     len[i]:=sqrt(sqr(s[i].x)+sqr(s[i].y));   for i:=2 to n do     begin       t[i]:=arccos(s[i].x/len[i]);       if s[i].y<0 then t[i]:=2*pi-t[i];     end;   for i:=1 to n do     num[i]:=i;   check:=false;   for i:=2 to n do     if (abs(t[i]-pi)>1e-8)and(t[i]<pi)and(0<t[i]) then check:=true;   if check then     qsort(2,n) else     begin       for i:=1 to n do         if (s[i].x>0)and(t[i]=0) then t[i]:=2*pi;       qsort2(2,n);     end;   writeln(n);   for i:=1 to n do     writeln(num[i]); end;   begin   readdata;   solve; end. This test helped me: 4 0 0 1 -1 2 0 1 1   answer may be 4 1 2 3 4   or 4 1 4 3 2 I don't know how could i choose next point. I have some ideas about it: 1. The solution isn't very complexity(maybe it uses sorting) 2. I think, Elephpotamus always can eat all pumpkins 3. And our path should be spin or smth like it. Help plz It's nice and easy problem   1) find the point witch min Y 2) build angles 3) sort angles 4) print answer. What angles should I built? Between (a[1],a[ymin]) and (a[ymin],a[i])? A(Point[i].X, Point[i].Y) B(Ymin.X, Ymin.Y) C(Point[i].X, Ymin.Y) I have <...> as result of doing this task. I think  it's terrible. Help me more. I don't know what kind of mistake I have... WA8 is terrible   Edited by author 01.04.2006 04:49 If you want I can send my solution! My e-mail: Pio@mail.by I used idea of solution to problem 1173 with some updates: At 1173: "No 3 points on the same straight line" At 1444: "Not all points on the same straight line". Try tests, were some points are on the same straight line. My WA solution breaks on the same tests. Hello!   My submit has status "problem locked". What does it mean? This problem is under investigation. When it will be unlocked, your submits will be checked automatically. I think, that my program is right... but WA :( Pls help 5 1 0 0 0 0 -10 0 10 0 100   Answer: 5 1 5 4 2 3 One more test:   14 4 4 3 2 2 2 0 0 1 0 1 2 2 4 5 6 3 6 7 7 7 5 6 2 3 0 5 0   One of possible answers:   14 1 10 11 2 12 14 13 5 4 3 8 6 7 9  |  
  |