Problem A
References |
Problem B
Sum of powers |
Problem C
Game |
Problem D
Crossword |
Problem E
Magic of David Copperfield |
Problem F
Puncher |
Problem G
Flying Stars |
Problem H
Divide et unita |
Input file | INPUT.TXT |
Output file | OUTPUT.TXT |
Time-limit/Test | 20 seconds |
for some fixed natural k and different natural n. He observed that calculating ik for all i (1<=i<=n) and summing up results is a too slow way to do it, because the number of required arithmetical operations increases as n increases. Fortunately, there is another method which takes only a constant number of operations regardless of n. It is possible to show that the sum Sk(n) is equal to some polynomial of degree k+1 in the variable n with rational coefficients, i.e.,
for some integer numbers M, ak+1, ak, ... , a1, a0.
We require that integer M be positive and as small as possible. Under this condition the entire set of such numbers (i.e. M, ak+1, ak, ... , a1, a0) will be unique for the given k. You have to write a program to find such set of coefficients to help the schoolboy make his calculations quicker.
Input
The input file contains a single integer k (1<=20).
Output
Write integer numbers M, ak+1, ak, ... , a1, a0 to the output file in the given order. Numbers should be separated by one or more spaces. Remember that you should write the answer with the smallest positive M possible.
Sample input
2Output for the sample input
6 2 3 1 0