码迷,mamicode.com
首页 > 其他好文 > 详细

The Queen's Super-circular Patio 求栏杆(计算几何)

时间:2019-07-10 16:34:44      阅读:81      评论:0      收藏:0      [点我收藏+]

标签:integer   pen   几何   height   技术   com   most   图片   image   

技术图片

Input

The first line of input contains a single integer P, (1 ≤ P ≤ 1000), which is the number of data sets that follow. Each data set should be processed identically and independently.

Each data set consists of a single line of input. It contains the data set number, K,the number, N (3 ≤ N ≤ 20), of stones in each circle and the number, M (1 ≤ M ≤ 15), of circles of stones around the central stone.

Output

For each data set there is a single line of output. It contains the data set number, K, followed by a single space which is then followed by the radius (in queenly feet) of the stones in the outermost ring (to 3 decimal places) which is followed by a single space which is then followed by the length (in queenly feet) of the fence (to 3 decimal places).

Sample Input

3
1 3 1
2 7 3
3 11 5

Sample Output

1 6.464 79.400
2 3.834 77.760
3 2.916 82.481

题意:现有一个半径为1的圆,然后给出层数和要求一层要求填充完的圆的个数,求最外层的填充圆的半径和将其围起来的栏杆周长(周长就等于前面半径对应的圆的周长加上n*直径)
分析:技术图片
求出r3后,如果要接着往外加层数,就利用r(n)/r(n+1)=r(n+1)/r(n+2);求出接下去的圆的半径。
 

The Queen's Super-circular Patio 求栏杆(计算几何)

标签:integer   pen   几何   height   技术   com   most   图片   image   

原文地址:https://www.cnblogs.com/starve/p/11164586.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!