You participate in a competition in which you have one hundred opponents. The competition will last for rounds. In each round, you can exclude some opponents from the competition (always at least one) and you will be rewarded for their elimination.
The reward for elimination in opponents from the number p is
100.000, - * v / p
Calculated in whole numbers (ie the lower whole part).
So, for example, if you eliminate 50 opponents from the initial 100 in the first round, you will get 50,000. If you eliminate 30 of the remaining 50 in the second round, you get 100.000, - * 30/50 = 60.000, - and you have a total of 110.000, - If you eliminate the last 20 opponents in the last round, you get 100.000, - * 20/20 = 100.000, - and your total profit will be 210,000
Write a program that determines and prints the maximum possible profit for the specified number of rounds and on the next line the numbers of opponents (separated by a space) that you have to eliminate in each round.
Example:
Input:
3
Exit:
280000
90 9 1
Hint
Solve the problem with the help of recursion, ie if you have NN opponents and KK rounds, recursively calculate the cases when you have 11, 22, and from N - 1N ? 1 opponents and K - 1K ? 1 rounds - select the maximum from all these cases.
Due to the number of possibilities, it is necessary to memorize the results once and not to calculate them again.