Spencer really wants to go to the Canadian Computing Olympiad (CCO), the next stage of the Canadian Computing Competition (CCC). He wants to go so much that he cheated on the CCC. His master plan is the following:
- Before the contest, Spencer goes to Andy, a CCC organizer, and buys "score booster tokens" worth an arbitrary positive integer amount of points to add to his score. Each token costs the same amount regardless of point value.
- During the contest, Spencer activates the tokens to add to his score. His score increases by the point value of the token. The token cannot be used again.
- ???
- Profit!
Please note that Spencer isn't very good at programming, so he cannot score anything by himself without using tokens.
During the 2018 CCC, Spencer was disqualified as he got 77 / 75
. Instead of giving up, Spencer registered an account under a different name to try again in the 2019 CCC.
To prevent future cheating, the CCC in the future will have a full score between and inclusive, and will be announced only when the contest starts. Spencer wants to make sure he is ready for the new CCC contest, so he can use the tokens to create any score between and , but also to make sure it's impossible to have a score over . Given these requirements, help him find the minimum number of tokens he needs to buy!
Input Specification
The only input will be a single integer .
For of the points, .
Output Specification
First, print a single integer , the minimum number of tokens he needs to buy.
In the next line, print positive integers, the values of the tokens he should buy.
Sample Input 1
2
Sample Output 1
2
1 1
Sample Explanation 1
1 = 1
2 = 1 + 1
Sample Input 2
6
Sample Output 2
3
1 2 3
Sample Explanation 2
1 = 1
2 = 2
3 = 1 + 2
4 = 1 + 3
5 = 2 + 3
6 = 1 + 2 + 3
Comments
Picture: black and white.
Can it output it in a different order?
This comment is hidden due to too much negative feedback. Show it anyway.
Umm, can't you just use one number to token for the whole thing? ie: if is equal to 5, just use a token worth 5
He needs to be able to make any number from to , not just .
Thanks