1. 程式人生 > >hd 2134 Cuts the cake

hd 2134 Cuts the cake

Cuts the cake

Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2537    Accepted Submission(s): 1612


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 Author ☆RPG♀月野兔☆ Source
#include<stdio.h>
#include<math.h>
#define PI 3.1415926
int main()
{
    double r,s,r1,r2;
    while(scanf("%lf",&r)!=EOF&&(r!=0))
    {
      s=PI*r*r;
      r1=(double)sqrt(s/(3*PI));
      r2=(double)sqrt((2*s)/(3*PI));
      printf("%.3f %.3f\n",r1,r2);
                                       }
return 0;    
}

相關推薦

hd 2134 Cuts the cake

Cuts the cake Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2537    Accepted S

HDU 2134 Cuts the cake

intro pri ott 圖片 for lan tip using mis http://acm.hdu.edu.cn/showproblem.php?pid=2134 Problem Description Ice cream took a bronze medal

問題 J: Frosting on the Cake

white 超時 如果 horizon strip numbers 描述 put ont 問題 J: Frosting on the Cake 時間限制: 1 Sec 內存限制: 128 MB提交: 159 解決: 56[提交][狀態][討論版][命題人:admin]

HDU4762 Cut the Cake

mat pen acm cin public can ger treenode cli HDU4762 Cut the Cake 思路:公式:n/m(n-1) //package acm; import java.awt.Container; impor

hd 1597 find the nth digit(解決超時的牛氣哄哄的新辦法)

<h1 style="COLOR: #1a5cc8"><div class="panel_title" align="left"><h1 style="COLOR: #1a5cc8">find the nth digit</h1&g

poj 3587 The Biggest Cake 正弦定理

題意: 給n個點,求其中3個點構成三角形的最大外接圓半徑。 分析: 正弦定理,A/sina=B/sinb=C/sinc=ABC/(2*s)=2*R。 程式碼: //poj 3587 //sep9 #include <iostream> #include <

[CSS] Showing horizontal scrollbar always for the table

nbsp overflow tab spl spa horizon clas pre idt table { display: block; overflow: scroll; width: 200px; height:95vh;

[LeetCode] Reshape the Matrix 矩陣重塑

ren ati num 我們 資料 call posit tar led In MATLAB, there is a very useful function called ‘reshape‘, which can reshape a matrix into a ne

ZOJ - 3228 Searching the String (AC自己主動機)

won key wid roc lap processor som multiple pla Description Little jay really hates to deal with string. But moondy likes it very mu

SQL Server導入報錯:The LocaleID 4 is not installed on this system

code page localeid 936 問題描述:通過SQLServer導入導出向導導入中文字符集數據,遇到The LocaleID 4 is not installed on this system.錯誤。解決方法:我發現客戶服務器操作系統雖然不支持Chinese (Simplified)

HDU 4930 Fighting the Landlords(扯淡模擬題)

href blank 。。 clear break 輸出 family fig set Fighting the Landlords 大意: 鬥地主。。。。 分別給出兩把手牌,肯定都合法。每張牌大小順序是Y (i.e. colored Joker) &g

The connection to adb is down, and a severe error has occured

真的 findstr ole pla a10 tool fcm ott art 相信不少人在android中都遇到了你下面不好解決的問題: 首先描寫敘述癥狀,例如以下圖 解決方法: 方法1:先在cmd中adb kill-server,然後adb -startser

HDOJ4355-Party All the Time(三分)

input arc cat ans 5.1 sea nim res stat Problem Description In the Dark forest, there is a Fairy kingdom where all the spirits will go to

HDOJ2438:Turn the corner(計算幾何 + 三分)

scan can 計算 closed 4.5 pri cross cli idt Problem Description Mr. West bought a new car! So he is travelling around the city.One day he c

F - Find The Bone

.com col unit table 輸入 mce 每次 move each F - Find The Bone Zane the wizard is going to perform a magic show shuffling the cups. There are

[SCSS] Write similar classes with the SCSS @for Control Directive

att oop enc rem coo tro from mil for Writing similar classes with minor variations, like utility classes, can be a pain to write and upda

The server quit without updating PID file 報錯

art launch quit not date some -s install clean mysql.server start 報錯:The server quit without updating PID file (/usr/local/var/mysql/zhan

The Accidental DBA:Troubleshooting Performance

顯示 tin 管理員 ant cau adding cli multi ssms 最近重新翻看The Accidental DBA,將Troubleshooting Performance部分稍作整理,方便以後查閱。一、Baselines 網友提供的性能基線的含義:每天使

HDU 3591 The trouble of Xiaoqian(多重背包+全然背包)

給他 cas 維數 color cost 代碼 01背包 size code HDU 3591 The trouble of Xiaoqian(多重背包+全然背包) http://acm.hdu.edu.cn/showproblem.php?pid=3591 題意:

UVA12096 - The SetStack Computer(set + map映射)

dex onos keyword ets undefine case uva sans break UVA12096 - The SetStack Computer(set + map映射) 題目鏈接 題目大意:有五個動作: push : 把一個空集合{}放到