301145: CF213D. Stars

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Stars

题意翻译

## 题目描述 Furik 喜欢画星星。恒星是一种图形,我们画一个规则的五边形,画出其中所有的对角线。(如下图所示) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF213D/de090c3465fd4bd00462358563eb01e18b887532.png) 最近他决定教 Rubik 画星星。经过多年的训练,Rubik 可以很容易地画出星星。但现在 Furik 决定测试 Rubik,并使任务复杂化。Rubik 必须绘制 $n$ 颗星星,遵守以下规则: - 所有星星必须一次画完(即禁止将笔从纸上拿走); - 禁止对同一段非零长度线段涂画一次以上; - 恒星只能在顶点相交; - 规则的五边形的边长必须等于 $10$ ,其中每一颗星都由 Rubik 绘制。 帮助 Rubik 完成这项艰巨的任务。 ## 输入格式 一行包含一个整数($1 \leq n \leq 100$),表示需要 Rubik 绘制的星星数。 ## 输出格式 在第一行输出一个整数 $m$($1 \leq m \leq 5 \times n$)。在接下来的 $m$ 行上,打印 $m$ 个不同点的坐标,精度至少为 $9$,小数点后最多为 $100$ 位。所有坐标的绝对值不得超过 $5000$ 。 在接下来的 $n$ 行中,每行都打印 $5$ 个整数,表示按顺时针或逆时针顺序构成给定星形的点的序号。 在下一行打印 $5 \times n+1$ 个整数,按顺序表示 Rubik 画星星的点号。也就是说,如果序号为 $i$ 的数字是 $A_i$,序号为 $i+1$ 的数字是 $A_{i+1}$,然后用一条线在序号 $A_i$ 点与序号 $A_{i+1}$ 的点相连。 您可以考虑从 $1$ 到 $m$ 的输出的所有 $m$ 个打印点的顺序,并用空格分隔行上的数字。 请注意,答案的验证不精确。你需要试着获得尽可能精确的解决方案。验证器执行所有计算时,考虑到实际情况,答案的绝对误差不超过 $10^{-8}$。 ## 提示 样例中点的初始位置为: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF213D/9ed24952d8da92f918fab9096996a3b04fe818fe.png) $Rubik$ 可以绘制的顺序是: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF213D/7c6a93950d224a9b74c04eee31c5dd264bd58980.png)

题目描述

Furik loves painting stars. A star is a shape that results if we take a regular pentagon and paint all diagonals in it. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF213D/de090c3465fd4bd00462358563eb01e18b887532.png)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} $ .

输入输出样例

输入样例 #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: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF213D/9ed24952d8da92f918fab9096996a3b04fe818fe.png)The order in which Rubik can paint segments is: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF213D/7c6a93950d224a9b74c04eee31c5dd264bd58980.png)

Input

题意翻译

## 题目描述 Furik 喜欢画星星。恒星是一种图形,我们画一个规则的五边形,画出其中所有的对角线。(如下图所示) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF213D/de090c3465fd4bd00462358563eb01e18b887532.png) 最近他决定教 Rubik 画星星。经过多年的训练,Rubik 可以很容易地画出星星。但现在 Furik 决定测试 Rubik,并使任务复杂化。Rubik 必须绘制 $n$ 颗星星,遵守以下规则: - 所有星星必须一次画完(即禁止将笔从纸上拿走); - 禁止对同一段非零长度线段涂画一次以上; - 恒星只能在顶点相交; - 规则的五边形的边长必须等于 $10$ ,其中每一颗星都由 Rubik 绘制。 帮助 Rubik 完成这项艰巨的任务。 ## 输入格式 一行包含一个整数($1 \leq n \leq 100$),表示需要 Rubik 绘制的星星数。 ## 输出格式 在第一行输出一个整数 $m$($1 \leq m \leq 5 \times n$)。在接下来的 $m$ 行上,打印 $m$ 个不同点的坐标,精度至少为 $9$,小数点后最多为 $100$ 位。所有坐标的绝对值不得超过 $5000$ 。 在接下来的 $n$ 行中,每行都打印 $5$ 个整数,表示按顺时针或逆时针顺序构成给定星形的点的序号。 在下一行打印 $5 \times n+1$ 个整数,按顺序表示 Rubik 画星星的点号。也就是说,如果序号为 $i$ 的数字是 $A_i$,序号为 $i+1$ 的数字是 $A_{i+1}$,然后用一条线在序号 $A_i$ 点与序号 $A_{i+1}$ 的点相连。 您可以考虑从 $1$ 到 $m$ 的输出的所有 $m$ 个打印点的顺序,并用空格分隔行上的数字。 请注意,答案的验证不精确。你需要试着获得尽可能精确的解决方案。验证器执行所有计算时,考虑到实际情况,答案的绝对误差不超过 $10^{-8}$。 ## 提示 样例中点的初始位置为: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF213D/9ed24952d8da92f918fab9096996a3b04fe818fe.png) $Rubik$ 可以绘制的顺序是: ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF213D/7c6a93950d224a9b74c04eee31c5dd264bd58980.png)

加入题单

算法标签: