|  | 
|  | 
| back to board | Discussion of Problem 1020. RopeWA! Please, tell me - what's wrong here I have changed a lot: readln to read, integer to longint, double toerxtended. But get WA!
 
 Please, tell me - what's wrong here. I want not to send accepted
 program which is on the message board, but to understand my error.
 Can I use any variable on Timus - like a, a0? Does sqrt work on Timus?
 Does Pascal has constant PI?
 
 Thanks for any help.
 
 program p1020;
 var
 i,n:longint;
 r,res,a0,b0,a1,b1,a2,b2:extended;
 begin
 read(n,r);
 read(a1,b1);
 res := 2*PI*r; a0 := a1; b0:=b1;
 for i:=1 to n-1 do
 begin
 read(a2,b2);
 res := res + sqrt((a2-a1)*(a2-a1)+(b2-b1)*(b2-b1));
 a1 := a2; b1:=b2;
 end;
 res := res + sqrt((a2-a0)*(a2-a0)+(b2-b0)*(b2-b0));
 writeln(res:0:2);
 end.
 
 | 
 | 
|