记录编号 61511 评测结果 AAAAAAAAAA
题目名称 饥饿的母牛 最终得分 100
用户昵称 GravatarCAX_CPG 是否通过 通过
代码语言 Pascal 运行时间 0.003 s
提交时间 2013-06-11 11:56:00 内存使用 0.30 MiB
显示代码纯文本
program hungry;
uses math;
var test : longint;
   l,d,s,r,ro,x : extended;

function calc1:extended;
begin
   exit(pi*s*s);
end; { calc1 }

function calc2:extended;
begin
   exit((1-2*arccos(d/s)/(2*pi))*pi*s*s+d*sqrt(s*s-d*d));
end; { calc2 }

function calc3:extended;
begin
   exit((1-2*arctan(l/(2*d))/(2*pi))*pi*s*s+2*pi*sqr(s-ro)*(pi-arctan(2*d/l))/(2*pi)+l*d/2);
end; { calc3 }

function calc4:extended;
begin
   x:=sqrt(r*r-sqr(l/2));
   exit(calc3-(pi*r*r*2*arccos(l/(2*r))/(2*pi)-x*l/2));
end; { calc4 }

function calc5:extended;
var a,b	: extended;
begin
   a:=pi-arctan(2*d/l);
   b:=pi-a-arcsin(l*sin(a)/r);
   exit(calc4-2*(pi*r*r*b/(2*pi)-r*l*sin(b)/2));
end; { calc5 }

begin
   assign(input,'hungry.in');reset(input);
   assign(output,'hungry.out');rewrite(output);
   readln(test);
   while test<>0 do
   begin
      dec(test);
      readln(l,d,s);ro:=sqrt(sqr(l/2)+sqr(d));
      r:=s-ro;
      if s<=d then writeln(calc1:0:2)else
	 if s<ro then writeln(calc2:0:2)else
	    if 2*(s-ro)<=l then writeln(calc3:0:2)else
	       if s-ro<=l then writeln(calc4:0:2)else writeln(calc5:0:2);
   end;close(input);close(output);
end.