Testing Round 13
A
Santa Claus and Candies
Codeforces
1000
原题
←B →
翻译中…

Santa Claus has $*n*$ candies, he dreams to give them as gifts to children.

翻译中…

What is the maximal number of children for whose he can give candies if Santa Claus want each kid should get distinct positive integer number of candies. Santa Class wants to give all $*n*$ candies he has.

翻译中…

Input

翻译中…

The only line contains positive integer number $*n*$ ($1 ≤ *n* ≤ 1000$) — number of candies Santa Claus has.

翻译中…

Output

翻译中…

Print to the first line integer number $*k*$ — maximal number of kids which can get candies.

翻译中…

Print to the second line $*k*$ distinct integer numbers: number of candies for each of $*k*$ kid. The sum of $*k*$ printed numbers should be exactly $*n*$.

翻译中…

If there are many solutions, print any of them.

翻译中…

样例

Input #1
5
Output #1
2
2 3
InputCopy OutputCopy
Input #2
9
Output #2
3
3 5 1
InputCopy OutputCopy
Input #3
2
Output #3
1
2
InputCopy OutputCopy
题目信息
题号
753A
所属比赛
时间限制
1 s
内存限制
256 MB
标签
动态规划
贪心
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。