Why my solution is wrong? Help please
This is my program
program n1084;
var a, r:integer;
c, l, x, st, cosf, tgf, sinf, f, ss, st1, so, so1:real;
begin
readln(a, r);
if r<=a/2 then
c:=3.14*r*r
else
if r>=sqrt(a*a/2) then
c:=a*a
else
begin
l:=a/2-sqrt(r*r-a*a/4);
x:=sqrt(2*l*l);
st:=0.5*l*l;
cosf:=(2*r*r-x*x)/(2*r*r);
sinf:=sqrt(1-cosf*cosf);
tgf:=sqrt((1/(cosf*cosf))-1);
f:=ArcTan(tgf);
ss:=f*r*r/2;
st1:=0.5*r*r*sinf;
so:=ss-st1;
so1:=st-so;
c:=a*a-4*so1;
end;
write(c:0:3);
end.
When I tested it in home, answer was right. But when I send it, I have error in 2 test, Wrong Answer. Why?