Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

【两种情况】 分情况讨论,

Posted by WilliamACM at 2013-01-21 13:26:04 on Problem 3365
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <algorithm>
#include <math.h>
using namespace std;
double w,h;
const double pi=acos(-1.0);
int main()
{
    //freopen("in.txt","r",stdin);
    while(scanf("%lf%lf",&h,&w),w+h)
    {
        double ans=0,r;
        r=min(h/2,w/(2*(pi+1)));
        ans=max(ans,pi*r*r*h);
        r=h/2/pi;
        ans=max(ans,pi*r*r*(w-2*r));
        printf("%.3f\n",ans);

    }
    return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator