HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Kovrov IT > problem:


2007.I. 50274 - Boundary Troops

Guest
• Discussion of problem (1)

Volume problems

• 2007.A. 50671 - Phalanx
• 2007.B. 50270 - Bitsorting
• 2007.C. 50640 - Cubes
• 2007.D. 50271 - Factorial
• 2007.E. 50663 - Lights
• 2007.F. 50690 - Parliament
• 2007.G. 50272 - Strange Numbers
• 2007.H. 50273 - Two Captains
• 2007.I. 50274 - Boundary Troops
• 2007.J. 50275 - Wedding
• 2007.K. 50276 - Nice Floor
• 2008.A. 50672 - Math and Soldiers
• 2008.B. 50261 - Roads
• 2008.C. 50262 - Brackets
• 2008.D. 50279 - Bit Decoder
• 2008.E. 50263 - Points
• 2008.F. 50972 - Division

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Автор: Михаил Копачев, РГАТА. Difficulty Gamma

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