WA#3

I couldn't understand my mistake! On my tests it works correct.

program project1;

var

n, i : longint;

r, res, x, y, x1, y1, x0, y0 : extended;

begin

{$IFNDEF ONLINE_JUDGE}

assign(input, 'input.txt');

assign(output, 'output.txt');

reset(input);

rewrite(output);

{$ENDIF}

readln(n, r);

readln(x, y);

x0:=x;

y0:=y;

res:=2*pi*r;

for i:=1 to n-1 do begin

readln(x1, y1);

res:=res+sqrt(sqr(x1-x)+sqr(y1-y));

y:=y1;

x:=x1;

end;

res:=trunc(res*100)/100;

write((res+sqrt(sqr(x1-x0)+sqr(y1-y0))):1:2);

{$IFNDEF ONLINE_JUDGE}

close(input);

close(output);

{$ENDIF}

end.