POJ1405Heritage大树相乘
发布时间:2020-12-14 02:23:23 所属栏目:大数据 来源:网络整理
导读:H - Heritage Crawling in process... Crawling failed Time Limit: 1000 MS???? Memory Limit: 65536 KB???? 64bit IO Format: %I64d %I64u Submit Status Description Your rich uncle died recently,and the heritage needs to be divided among your rel
H - Heritage
Crawling in process...
Crawling failed
Time Limit:1000MS????Memory Limit:65536KB???? 64bit IO Format:%I64d & %I64u
Submit
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
The only line of input contains the single integer N (1 <= N <= 18).
Output
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 a[i]=a[i-1]*(a[i-1]-1)+1; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |