Parliament
Time limit1sMemory limit128 MB
Split N delegates into groups of distinct sizes so that the product of the sizes is maximized, and print the sizes in ascending order.
- Level
Medium4 of 10
- Topics
- Math, Greedy, Combinatorics
- Solved
- No attempts yet
Problem
A newly convened parliament has delegates. By the current regulation the delegates must be split into disjoint groups whose sizes are all different, and every day each group sends exactly one of its members to a conciliatory committee. The committee's composition must be different on every day, and the parliament stays in session only as long as this can be done.
Write a program that determines how many delegates each group should contain so that the parliament works for as long as possible.
Input
A single integer ().
Output
Print the sizes of the groups that let the parliament work for the maximum possible time, on a single line in ascending order and separated by spaces. (This choice of group sizes is uniquely determined.)