| 记录编号 | 
        35891 | 
        评测结果 | 
        AAAAAAAAAA | 
    
    
        | 题目名称 | 
        557.饥饿的母牛 | 
        最终得分 | 
        100 | 
            
    
    
        | 用户昵称 | 
         kaaala | 
        是否通过 | 
        通过 | 
    
    
        | 代码语言 | 
        C++ | 
        运行时间 | 
        0.004 s  | 
    
    
        | 提交时间 | 
        2012-03-06 08:33:14 | 
        内存使用 | 
        0.27 MiB  | 
        
    
    
    
    		显示代码纯文本
		
		#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
const double PI=acos(0.0)*2;
int T,L,D,S;
double ans;
int main()
{
	freopen("hungry.in","r",stdin);
	freopen("hungry.out","w",stdout);
	scanf("%d",&T);
	while(T--)
	{
		scanf("%d%d%d",&L,&D,&S);
		double k=S-sqrt(D*D+L*L/4.0);
		if(k<=0)
		{
			if(S<=D)
				printf("%.2lf\n",PI*S*S);
			else
			{
				double l=acos(D/(double)S);
					printf("%.2lf\n",PI*S*S*(PI-l)/PI+S*sin(l)*D);
			}
			continue;
		}
		double l=atan2(L/2.0,D),ans=PI*S*S*(PI-l)/PI+D*L/2.0,p=k*k-L*L/4.0;
		if(p<0)
		{
			ans+=PI*k*k*(PI/2+l)/PI;
			printf("%.2lf\n",ans);
			continue;
		}
		else
		p=sqrt(p);
		ans+=p*L/2.0;
		double q=atan2(p,L/2.0);
		ans+=PI*k*k*(PI/2.0+l-q)/PI;
		printf("%.2lf\n",ans);
	}
	return 0;
}