比赛 20110722 评测结果 WEEEEEEEEE
题目名称 饥饿的母牛 最终得分 0
用户昵称 wo shi 刘畅 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2011-07-22 10:36:54
显示代码纯文本
var
  t,i,l,d,s:longint;
  xiebian,mianji,dibian,n,x,now,h,nn,r,xiaos:double;

begin
  assign(input,'hungry.in'); reset(input);
  assign(output,'hungry.out'); rewrite(output);
  readln(t);
  for i:=1 to t do
  begin
    readln(l,d,s);
    xiebian:=(l*l/4)+d*d;
    mianji:=pi*s*s;
    dibian:=sqrt(s*s-d*d)*2;
    n:=arctan(dibian/(2*d))*2/pi*180;
    if s<=d then writeln(mianji:0:2);

    if (d*d<s*s)and(s*s<=xiebian) then
    writeln(mianji+(dibian*d)/2-n/360*mianji:0:2);

    if (s*s>xiebian)and(s<=sqrt(xiebian)+l/2) then
    begin
      x:=l*s/sqrt(xiebian);
      h:=sqrt(s*s-x*x/4);
      nn:=90+arctan(l/(2*d))/pi*180;
      r:=sqrt(xiebian);
      r:=s-r;
      xiaos:=pi*r*r;
      now:=arctan(l/(2*d))*2/(pi*2)*mianji;
      writeln(mianji- now + l*d/2
      +2*(xiaos*nn/360):0:2);
    end;
  end;
  close(input);
  close(output);
end.