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. ZJOI2018 round^2 游记

    Day0 一早起来6点左右,吃完早饭去班里拿了书包就来机房,说实话怕被打[手动滑稽]. 在车上大约经历了3个半小时的车程,终于到达了目的地:余姚.当然基本上大家的设备电量都不多了,除了某些上车睡觉的大 ...

  2. [2016北京集训试题6]网络战争-[最小割树(网络流)+kd-tree+倍增]

    Description A 联邦国有 N 个州,每个州内部都有一个网络系统,有若干条网络线路,连接各个 州内部的城市. 由于 A 国的州与州之间的关系不是太好,每个州都只有首府建立了到别的州的网络.具 ...

  3. Linux常用文件权限控制命令

    一,查看文件属主属组ls -l [root@localhost app]# ls -l total 302832 drwxr-xr-x. 4 lhc lhc 4096 Nov 18 16:05 apa ...

  4. 15-[mysql内置功能]--函数,流程控制 (未完成)

    1.MySQL中提供了许多内置函数 一.数学函数 ROUND(x,y) 返回参数x的四舍五入的有y位小数的值 RAND() 返回0到1内的随机值,可以通过提供一个参数(种子)使RAND()随机数生成器 ...

  5. iOS开发-通过正则表达式进行各种判断银行卡,车牌号,邮箱地址,QQ,身份证,全字母,仅输入字母或数字同时包含大小写字母和数字,仅能输入中文等

    /* *  验证银行卡号是否正确 *  车牌号验证 *  检验邮箱地址是否正确 *  手机号中间四位密文显示 *  判断QQ号是否正确(5-11位) *  判断身份证号是否正确(如末位为字母请用“x” ...

  6. loj2230 「BJOI2014」大融合

    LCT裸题 我LCT学傻了这题明显可以树剖我不会树剖了 本来的siz是Splay上的子树和,并没有什么用. 所以每个点维护虚子树和和子树和 虚子树和即虚边连接的子树和,且只有在access和link操 ...

  7. 程序员 vs HR(皮这么一下很开心)

    最近网络上一段 HR VS 程序员 的表情包火了 来来来 我们近距离感受下 来源|网络:http://t.cn/RuTKC8B 哈哈哈!大家可以留言说说你们面试时候的趣事 更多内容关注公众号:51re ...

  8. 公网API安全--OAuth认证

    之前写过一个基于签名的公网API访问安全控制,另一种方式是基于OAuth认证协议做安全控制. 说明 用户访问A客户端,使用B的服务及资源.B只有征得用户的授权,才允许A客户端使用B上用户的资源和服务. ...

  9. arpspoof+driftnet+ ARP欺骗简单图片抓取

    arpspoof+driftnet+ ARP欺骗简单图片抓取 driftnet是一款简单而使用的图片捕获工具,可以很方便的在网络数据包中抓取图片.该工具可以实时和离线捕获指定数据包中是图片 环境 受害 ...

  10. 中国的互联网企业逐步走向“单一企业多样化,商业生态同质化”,美国的互联网企业则会走向“单一企业专业化,商业生态多样化”:3.5星|《VUCA时代,想要成功,这些原则你一定得明白》

    VUCA时代,想要成功,这些原则你一定得明白(<哈佛商业评论>增刊) <哈佛商业评论>的10篇文章的合集.主题是VUCA时代,也就是当前复杂多变难预测的时代.大部分文章都是点到 ...