ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1084. Goat in the Garden

Accepted SHORT
Posted by brainail 21 Jan 2010 17:59
uses math;
var len,r:extended;
begin
 read(len,r);
 if(r<=len/2)then writeln((pi*r*r):0:3) else
 if(sqrt(2)*len/2<=r)then writeln((len*len):0:3) else
  writeln((pi*r*r-4*arccos(len/r/2)*r*r+2*len*sqrt(r*r-len*len/4)):0:3);
end.