HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


50274 - Boundary Troops

Guest
• Discussion of problem (1)

Section problems

• 50627 - Area of a polygon
• 50629 - Minuses
• 50632 - Again numbers game
• 50645 - Line
• 50273 - Two Captains
• 50270 - Bitsorting
• 50272 - Strange Numbers
• 50275 - Wedding
• 50274 - Boundary Troops
• 50602 - Birthday Ivanova
• 50603 - Rider
• 50615 - Moneybox
• 50619 - The Mars Rover
• 50622 - Sequence
• 50628 - Matrix
• 50638 - Message
• 50643 - Stepeny couples

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