cuts the cake

http://acm.hdu.edu.cn/showproblem.php?pid=2134

 

#include<stdio.h>
#include<math.h>
#define M 3.1415926
int main()
{
    int n;
    while(scanf("%d",&n),n)
    {
     double s1,s2,s3,r1,r2;
     s1= M*n*n;
     s2=s1/3;
     s3=s2*2;
     r1=sqrt(s2/M);
     r2=sqrt(s3/M);
     printf("%.3lf %.3lf\n",r1,r2);
    }
    return 0;
}

posted @ 2013-08-17 08:22  hpu张亚飞  阅读(143)  评论(0)    收藏  举报