QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 256 MB Total points: 100

#5625. 女王的超循环露台

Statistics

女王希望建造一个庭院,庭院中心是一块圆形石块,周围环绕着多圈圆形石块。每一圈中的所有石块大小相同,且每一圈的石块数量也相同。最内圈的石块与中心石块及相邻石块相切。其他圈中的石块与相邻内圈的石块以及同圈内的相邻石块相切。下图展示了一个包含 1 圈 3 块石块的庭院,以及一个包含 5 圈 11 块石块的庭院。庭院周围环绕着一道围栏,围栏沿着最外圈的石块边缘延伸,并在石块之间呈直线连接(图中较粗的线条所示)。

女王尚不确定每圈会有多少块石块,也不确定会有多少圈石块。为了应对她的决定,请编写一个程序来计算每一圈石块的大小以及周围围栏的长度。中心石块的半径为 1 个 queenly 英尺。

输入格式

输入的第一行包含一个整数 $P$ ($1 \le P \le 1000$),表示随后数据组的数量。每组数据应独立处理。

每组数据由单行输入组成。它包含数据组编号 $K$,每圈石块的数量 $N$ ($3 \le N \le 20$),以及石块圈数 $M$ ($1 \le M \le 15$)。

输出格式

对于每组数据,输出一行。包含数据组编号 $K$,后跟一个空格,接着是外圈石块的半径(单位为 queenly 英尺,保留 3 位小数),再后跟一个空格,最后是围栏的长度(单位为 queenly 英尺,保留 3 位小数)。

样例

输入 1

3
1 3 1
2 7 3
3 11 5

输出 1

1 6.464 79.400
2 3.834 77.760
3 2.916 82.481

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.