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

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


50274 - Boundary Troops

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

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

• 50254 - Lawyers Council
• 50260 - What about judges?
• 50259 - Many-coloured roads
• 50276 - Nice Floor
• 50270 - Bitsorting
• 50272 - Strange Numbers
• 50275 - Wedding
• 50273 - Two Captains
• 50274 - Boundary Troops
• 50278 - ATM
• 50277 - Unusual Lottery
• 50283 - Tetris 3D
• 50285 - Meat store
• 50279 - Bit Decoder
• 50284 - Knights of the Rook
• 50282 - Coins
• 50281 - Primes

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

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