比赛 20110722 评测结果 WAWWWWWWWW
题目名称 饥饿的母牛 最终得分 10
用户昵称 Yoghurt 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2011-07-22 11:31:58
显示代码纯文本
program hungry;
uses math;
const
        filename='hungry';
var
        n,l,d,s:longint;

procedure solve;
var
        i:longint;
        k,a,ans:double;
begin
        readln(n);
        for i:=1 to n do
        begin
                readln(l,d,s);
                if s<=d then
                begin
                        writeln(sqr(s)*pi:0:2);
                        continue;
                end else
                begin
                        k:=l/2/d;
                        if k=1 then
                        begin
                                ans:=(0.75*(2*pi))*s;
                        end else
                        begin
                                a:=arctan(2*k/(1-k*k));
                                ans:=(2*pi-a)*s;
                        end;
                        k:=d/l/2;
                        if k=1 then
                        begin
                                ans:=ans+(pi/2)*(s-sqrt(d*d+sqr(l/2)))*2;
                        end else
                        begin
                                a:=arctan(2*k/(1-k*k));
                                ans:=ans+(pi-a)*(s-sqrt(d*d+sqr(l/2)))*2;
                        end;
                        writeln(ans:0:2);
                end;
        end;
end;

begin
        assign(input,filename+'.in'); reset(input);
        assign(output,filename+'.out'); rewrite(output);

        solve;

        close(input); close(output);
end.