当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1405:Heritage

题目描述
Your rich uncle died recently, and the heritage needs to be divided among your relatives and the church (your uncle insisted in his will that the church must get something). There are N relatives (N <= 18) that were mentioned in the will. They are sorted in descending order according to their importance (the first one is the most important). Since you are the computer scientist in the family, your relatives asked you to help them. They need help, because there are some blanks in the will left to be filled. Here is how the will looks:

Relative #1 will get 1 / ... of the whole heritage,
Relative #2 will get 1 / ... of the whole heritage,
---------------------- ...
Relative #n will get 1 / ... of the whole heritage.

The logical desire of the relatives is to fill the blanks in such way that the uncle's will is preserved (i.e the fractions are non-ascending and the church gets something) and the amount of heritage left for the church is minimized.
输入解释
The only line of input contains the single integer N (1 <= N <= 18).
输出解释
Output the numbers that the blanks need to be filled (on separate lines), so that the heritage left for the church is minimized.
输入样例
2
输出样例
2
3

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 ural 1108

源链接: POJ-1405

最后修改于 2020-10-29T06:03:15+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536