A8585 | Stars
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Furik loves painting stars. A star is a shape that results if we take a regular pentagon and paint all diagonals in it.
Recently he decided to teach Rubik to paint stars. After many years of training Rubik could paint stars easily. But now Furik decided to test Rubik and complicated the task. Rubik must paint $n$ stars, observing the following rules:
- all stars must be painted in a single move (i.e. it is forbidden to take the pen away from the paper);
- it is forbidden to paint the same segment of non-zero length more than once;
- the stars can intersect only in their vertexes;
- the length of a side of the regular pentagon, in which Rubik paints each star, must equal 10.
Help Rubik to cope with this hard task.
Recently he decided to teach Rubik to paint stars. After many years of training Rubik could paint stars easily. But now Furik decided to test Rubik and complicated the task. Rubik must paint $n$ stars, observing the following rules:
- all stars must be painted in a single move (i.e. it is forbidden to take the pen away from the paper);
- it is forbidden to paint the same segment of non-zero length more than once;
- the stars can intersect only in their vertexes;
- the length of a side of the regular pentagon, in which Rubik paints each star, must equal 10.
Help Rubik to cope with this hard task.
输入格式
A single line contains an integer $(1<=n<=100)$ — the number of stars to paint.
输出格式
On the first line print an integer $m$ $(1<=m<=5·n)$ . On the next $m$ lines print coordinates of $m$ distinct points with accuracy of at least $9$ and at most $100$ digits after decimal point. All coordinates should not exceed $5000$ in their absolute value. On each of the next $n$ lines print $5$ integers — the indexes of the points that form the given star in the clockwise or counterclockwise order. On the next line print $5·n+1$ integers — the numbers of points in the order, in which Rubik paints stars. That is, if number with index $i$ is $a_{i}$ , and number with index $i+1$ is $a_{i+1}$ , then points with indexes $a_{i}$ and $a_{i+1}$ will have a segment painted between them.
You can consider all $m$ printed points indexed from 1 to $m$ in the order, in which they occur in the output. Separate the numbers on the lines with whitespaces.
Note that the answer has an imprecise validation. Try to obtain as accurate a solution as possible. The validator performs all calculations considering that the absolute error of a participant's answer is not more than $10^{-8}$ .
You can consider all $m$ printed points indexed from 1 to $m$ in the order, in which they occur in the output. Separate the numbers on the lines with whitespaces.
Note that the answer has an imprecise validation. Try to obtain as accurate a solution as possible. The validator performs all calculations considering that the absolute error of a participant's answer is not more than $10^{-8}$ .
输入输出样例
输入 #1
1
输出 #1
5 3.830127018922193 3.366025403784439 -3.601321235851749 10.057331467373021 0.466045194906253 19.192786043799030 10.411264148588986 18.147501411122495 12.490381056766580 8.366025403784439 1 2 3 4 5 1 3 5 2 4 1
The initial position of points in the sample is:
The order in which Rubik can paint segments is:

The order in which Rubik can paint segments is:

C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted