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

Разделы > Unsorted > задача:


50274 - Boundary Troops

Гость
• Обсуждение задачи (1)

Задачи раздела

• 50627 - Площадь многоугольника
• 50629 - Минусы
• 50632 - Снова игра в числа
• 50645 - Строки
• 50273 - Two Captains
• 50270 - Bitsorting
• 50272 - Strange Numbers
• 50275 - Wedding
• 50274 - Boundary Troops
• 50602 - День рождения Иванова
• 50603 - Ездец
• 50615 - Копилка
• 50619 - Марсоход
• 50622 - Последовательность
• 50628 - Матрица
• 50638 - Сообщение
• 50643 - Степень двойки

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

Если у вас есть предложения или пожелания по работе 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