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. 20155327Exp6 信息搜集与漏洞扫描

    20155327Exp6 信息搜集与漏洞扫描 实验过程 一.信息搜集 whois 在kali终端输入whois 网址,查看注册的公司.服务.注册省份.传真.电话等信息. dig或nslookup域名查 ...

  2. 26-[jQuery]-内容补充

    jquery除了咱们上面讲解的常用知识点之外,还有jquery 插件.jqueryUI知识点 jqueryUI 官网: https://jqueryui.com/ jqueryUI 中文网: http ...

  3. springmvc ajax传递json值时出现400错误 (问题出在sql上)

    问题出在sql的int不能达到 10000000000 这个值,从 int(11) 修改成 varchar(20) 就可以正常存储了

  4. 如何用Fiddle工具实现手机抓包

    Fiddler官方下载地址:http://fiddler2.com/ 在做手机或移动端APP的接口测试时,我们可以使用fiddler对APP进行抓包确认,抓取对应的网络交互信息.在抓取的信息中可以看到 ...

  5. Python学习之路:NumPy初识

    import numpy as np; //一维NumPy数组 myArray = np.array([1,2,3,4]); print(myArray); [1 2 3 4] //打印一维数组的形状 ...

  6. 二级域名 cookie session 共享

    setcookie('login','12345',0,'/','.abc.com'); session_set_cookie_params(0,'/','.abc.com');session_sta ...

  7. NAT概念解释(不完全版,但不会搞错...)

    NAT在计算器网络中,网络地址转换(Network Address Translation,缩写为NAT),也叫做网络掩蔽或者IP掩蔽(IP masquerading)是一种IP数据包在通过路由器或防 ...

  8. 别再犯低级错误,带你了解更新缓存的四种Desigh Pattern

    在我们使用分布式缓存Redis或者Memcached编写更新缓存数据代码时,我们总是会犯一个逻辑错误.先删除缓存,然后再更新数据库,而后续的操作会把数据再装载的缓存中.试想,两个并发操作,一个是更新操 ...

  9. RabbitMQ基础使用之集群构建

    简介 RabbitMQ是基于Erlang开发的一种消息队列服务,本篇文章主要部署三台机器用来实现集群的普通模式与镜像模式!欢迎大家吐槽交流学习! 特点 集群节点包括内存节点和磁盘节点,有了磁盘节点就支 ...

  10. Daily Scrumming* 2015.10.31(Day 12)

    一.今明两天任务表 Member Today’s Task Tomorrow’s Task 江昊 学习rails的HTTP控制 继续学习rails等项目工具 杨墨犁 学习semanticUI的用法,配 ...