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

Problem Description
Ice cream took a bronze medal in the Beijing match. Liu sir is very very happy. So he buys a cake for them. kiki is a child who likes eating, so the task of cuting cake was given to kiki. kiki is also a mischievous child. She wants to cut the cake in a different way. This is introduced in the figure below.

But there is a difficult problem.which is how to make each preson get equally many cake. kiki is not good at match, so she wants you help her solve this problem. 
 
Input
Input contains multiple test cases. Each line is a case. Each case contains only one integer R which is the radius. The input is terminated with a R of 0.
 
Output
For each test case, you should printf two numbers r2 and r1 in a line, accurate up to 3 decimal places, separate them by one space.
 
Sample Input
10
15
5
25
0
 
Sample Output
5.774 8.165
8.660 12.247
2.887 4.082
14.434 20.412
 
代码:

#include <bits/stdc++.h>
using namespace std; int main() {
double R;
while(cin >> R) {
if(R == 0)
break; double r1, r2;
r1 = sqrt(R * R / 3.0);
r2 = sqrt(R * R * 2.0 / 3.0); printf("%.3lf %.3lf\n", r1, r2);
}
return 0;
}

  

HDU 2134 Cuts the cake的更多相关文章

  1. hdu 4454 Stealing a Cake(三分之二)

    pid=4454" target="_blank" style="">题目链接:hdu 4454 Stealing a Cake 题目大意:给定 ...

  2. HDU 5640 King's Cake GCD

    King's Cake 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5640 Description It is the king's birthd ...

  3. HDU 4762 Cut the Cake(公式)

    Cut the Cake Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tota ...

  4. HDU 5640 King's Cake

    King's Cake Problem Description It is the king's birthday before the military parade . The ministers ...

  5. hdu 5640 King's Cake(BestCoder Round #75)

    King's Cake Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total ...

  6. HDU 4762 Cut the Cake

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4762 题目大意:将n个草莓随机放在蛋糕上,草莓被看做是点,然后将蛋糕平均切成m份,求所有草莓在同一块蛋 ...

  7. hdu 4762 Cut the Cake概率公式

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4762 题目大意:一个圆形蛋糕,现在要分成M个相同的扇形,有n个草莓,求n个草莓都在同一个扇形上的概率. ...

  8. hdu 5640 King's Cake(模拟)

    Problem Description   It is the king's birthday before the military parade . The ministers prepared ...

  9. hdu 4454 Stealing a Cake (三分)

    Stealing a Cake Time Limit: 5000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

随机推荐

  1. 20145234黄斐《网络对抗技术》实验八、Web基础

    Apache 先通过apachectl start命令开启Apach,使用netstat -aptn命令查看端口占用: 因为端口号80已经被占用(上次实验设置的),所以先修改/etc/apache2/ ...

  2. BZOJ1787_紧急集合_KEY

    题目传送门 LCA,对于每一个(x,y,z),两两求LCA得最优解或求出LCA不同于其他两组的那个为最优解. code: /************************************** ...

  3. P1903 [国家集训队]数颜色 带修改莫队板子

    大概就是要多加一维time 然后按照(l的块,r的块,time)为关键字排序 转移区间修改还是按照莫队的方式(每个修改要记修改前后的状态) 然后玄学dalao告诉窝块大小设为\(O(n^{\frac{ ...

  4. 【JUC源码解析】ScheduledThreadPoolExecutor

    简介 它是一个线程池执行器(ThreadPoolExecutor),在给定的延迟(delay)后执行.在多线程或者对灵活性有要求的环境下,要优于java.util.Timer. 提交的任务在执行之前支 ...

  5. 菜鸟vimer成长记——目录

    菜鸟vimer成长记——第0章.我眼中的vim学习 菜鸟vimer成长记——第1章.统一概念 菜鸟vimer成长记——第2.0章.模式初探 菜鸟vimer成长记——第2.1章.normal模式 菜鸟v ...

  6. Windows7 jmeter3.1安装(咋个安装?)

    这是一个比较详细的安装教程0.0,不懂可以私我,有错也可以私我 1.0    首先我们得有jdk,我选择的是1.8版本的jdk, QQ群:550654190,(进群答案:李熠)群文件里有. 进去后下载 ...

  7. Python字符串符号:双引号/单引号用法注解。

    众所周知python中单引号和双引号常常被我们所使用,例如print.input等等. 但是对于打印输出所引导的字符串大多都是用双引号的形式来做,"Hello,python!",而 ...

  8. ABP.ModuleZero.Feature——特性管理

    原文地址:http://aspnetboilerplate.com/Pages/Documents/Feature-Management  (在翻译原文的基础上增补更多细节说明) 简介 在大多数SAA ...

  9. 【视频编解码·学习笔记】12. 图像参数集(PPS)介绍

    一.PPS相关概念: 除了序列参数集SPS之外,H.264中另一重要的参数集合为图像参数集Picture Paramater Set(PPS). 通常情况下,PPS类似于SPS,在H.264的裸码流中 ...

  10. 【转】git乱码解决方案汇总

    git乱码解决方案汇 2012-11-04更新:官方的“终极”解决方案:msysGit1.7.10开始使用UTF-8编码保存文件名. 2011-10-24更新: 从一篇链接到本篇文章的文章(我对这篇文 ...