ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Kovrov IT 2007 > задача:


I. Boundary Troops

Задачи сборника

• A. Phalanx
• B. Bitsorting
• C. Cubes
• D. Factorial
• E. Lights
• F. Parliament
• G. Strange Numbers
• H. Two Captains
• I. Boundary Troops
• J. Wedding

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Автор: Михаил Копачев, РГАТА. Сложность Гамма

In order to take over the state boundary protection duty, some far frontier military base is to form a joint squad including one soldier from each platoon. To increase the vigilance of the soldiers, the commander has decided to change the daily composition of the duty squads (the compositions are considered to be different even if they differ only in one soldier). Help the commander to distribute k soldiers between different platoons in such a way that:

• it could be possible to form the greatest number of different squads;
• the number of the soldiers in the platoons turned out to be odd (to provide pair training after one of the soldiers goes on duty).

Your task is to make a program that will distribute k soldiers into platoons taking into account all the limitations described above.

Input
The input contains one integer k which represents the number of all the soldiers at the base.
Output
The first line of the output should contain the only number of the platoons m, you are using. The next line should contain m numbers, arranged in ascending order, divided by spaces and showing the quantity of soldiers in the platoons formed.
Limitations
0 < k ≤ 100

Input 1 Output 1
1
1
1
Input 2 Output 2
2
2
1 1
Input 3 Output 3
11
3
3 3 5

Для отправки решений необходимо выполнить вход.

www.contester.ru