Tuesday, June 7, 2016

Published June 07, 2016 by with 0 comment

uva 12578 solution

#include<cstdio>
#include<cmath>
#define pi acos(-1)
using namespace std;
int main()
{
    int t,l;
    scanf("%d",&t);
    while (t--)
    {
        scanf("%d",&l);
        double green,red,len,wid,r;
        len=(double)l;
        wid=len*0.60;
        r=len/5.0;
        red=pi*r*r;
        green=len*wid-red;
        printf("%.2lf %.2lf\n",red,green);
    }
    return 0;
}
      edit

0 comments:

Post a Comment