21370_Heritage

2022-5-16 18:19| 发布者: Hocassian| 查看: 49| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-89505206441100-Problem List-采集的数据-后羿采集器.html

Pro.ID

21370

Title

Heritage

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21370

AC

0

Submit

108

Ratio

0.00%

时间&空间限制

  • Time Limit: 10000/5000 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others)
  • 描述

    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.

    输入

    Multlple test cases. One case per line, containing the an integer N (1 ≤ N 18).

    输出

    Description

    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.

    Input

    Multlple test cases. One case per line, containing the an integer N (1 ≤ N 18).

    Output

    For each case, output the numbers that the blanks need to be filled (on separate lines), so that the heritage left for the church is minimized.

    Sample Input

    2

    Sample Output

    2
    3

    Source

    样例输入

    2

    样例输出

    2
    3

    提示

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部