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

I am david. Tabo. steel wrang. help meeeeeeee [5] // Problem 1084. Goat in the Garden 23 May 2002 09:58
uses math;
const p=3.14; {   -> p = pi , it will more accurate}
var a,r:integer;
    s,angl,cosa:real;
begin
  readln (a,r);
  if (2*r<a) then
    s:=p*r*r
  else
    if (sqrt(2)*r>a) then
      s:=a*a
    else
      begin
        cosa:=a/(2*r);
        angl:=2*arctan(cosa);
        angl:=p/2-angl;
        s:=((a/2)*sqrt(r*r-(a*a)/4))+angl*r*r/2;
        s := s * 4;
      end;
   writeln (s:10:3);
end.
ECUST Multistar Oh my god...................Too many Errors. [4] // Problem 1084. Goat in the Garden 23 May 2002 16:50
Oh my friend.Even though I try my best.
I still get 10 WA before I got AC with your program  8::::(
What a hard work....:-)
First of all
I use p=3.1415926535897
.......A terrible number, isn't it?
Then
if (2*r<a)  ==> if (2*r<=a)
if (sqrt(2)*r>a) ==> if (sqrt(2)*a/2<r) then
angl:=2*arctan(cosa); ==> angl:=2*arccos(cosa);
writeln (s:10:3); ===>  writeln (s:0:3);
Good luck next time.
By the way .I send a E-mail to you .
Reply it Ok??????

ECUST Multistar Ok I'll try it later... // Problem 1084. Goat in the Garden 23 May 2002 18:04
>
ECUST Multistar ......ZZZzzzzzzzz [1] // Problem 1084. Goat in the Garden 23 May 2002 18:07
> By the way my E-mail is fc_rainofstar_@163.com
Send a E-mail to me Ok?
I am david. Tabo. I send you letter!!! // Problem 1084. Goat in the Garden 24 May 2002 10:43