| 比赛 | 
    20110722 | 
    评测结果 | 
    WWWWWWWWWW | 
    | 题目名称 | 
    饥饿的母牛 | 
    最终得分 | 
    0 | 
    | 用户昵称 | 
    belong.zmx | 
    运行时间 | 
    0.000 s  | 
    | 代码语言 | 
    C++ | 
    内存使用 | 
    0.00 MiB  | 
    | 提交时间 | 
    2011-07-22 10:11:04 | 
显示代码纯文本
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
using namespace std;
const double pi=3.1415926535;
int i,j;
int t;
int l,d,s;
double ans,p,q,e;
double ar,kr,pr;
int main()
{
	freopen("hungry.in","r",stdin);
	freopen("hungry.out","w",stdout);
	scanf("%d",&t);
	for (i=1;i<=t;i++)
	{
		scanf("%d%d%d",&l,&d,&s);
		kr=(l/2)/d;
		pr=d*d+(l/2)*(l/2);
		e=s-sqrt(pr);
		if (e<=0)
		{
			ans=pi*s*s;
		}
		else
		{
			ar=atan(kr);
			p=(((2*pi-2*ar)/2*pi)/pi)*s*s;
			q=pi*e*e*((2*ar+pi)/(2*pi));
			ans=p+q;
		}
		printf("%0.2f\n",ans);
	}
}