A1243 | [COCI-2011_2012-contest6]#5 REZ
来源COCI
时间限制1s
内存限制128MB
通过 / 提交0/0
题目描述
Let‟s say that there exists a huge cake made from blueberries, strawberries and chocolate. It‟s shaped like a square, and has area of 100 square meters. Proffesionals strongly advise that cake is being cut with wet knife and eaten with dry spoon. Also:
Every cut begins and ends on the cake‟s perimeter A cut cannot lie completely on one of the sides No two cuts have the same starting and ending points, i.e. all cuts are different Parts obtained by these cuts are separated and counted only after last cut has been made. During cutting, the cake keeps its square form.
At least how many cuts need to be made in order to obtain at least K parts? Exactly what cuts to make?
Every cut begins and ends on the cake‟s perimeter A cut cannot lie completely on one of the sides No two cuts have the same starting and ending points, i.e. all cuts are different Parts obtained by these cuts are separated and counted only after last cut has been made. During cutting, the cake keeps its square form.
At least how many cuts need to be made in order to obtain at least K parts? Exactly what cuts to make?
输入格式
The first and only line of input contains an integer K (1 ≤ K ≤ 1 000 000), minimum number of parts that we must have after cutting is done.
输出格式
The first line of output should contain the requested number of cuts, N.
The following N lines should have four integers each, coordinates of starting and ending point for each cut made. Coordinates are represented in millimeters, and opposing corners of the cake have coordinates (-5000, -5000) and (5000, 5000). So for each point (x, y) lying on the side of the square, the following will hold:
max( |x|, |y| ) = 500
0.
The following N lines should have four integers each, coordinates of starting and ending point for each cut made. Coordinates are represented in millimeters, and opposing corners of the cake have coordinates (-5000, -5000) and (5000, 5000). So for each point (x, y) lying on the side of the square, the following will hold:
max( |x|, |y| ) = 500
0.
输入输出样例
输入 #1
1
输出 #1
0
输入 #2
4
输出 #2
2 -5000 -5000 5000 5000 5000 -5000 -5000 500
输入 #3
7
输出 #3
3 -5000 5000 0 -5000 -2000 -5000 5000 5000 -5000 0 5000 0
If only the number of cuts N is correct, you will get 50% of the points for that test case.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted