Santa Claus and Candies

题意翻译

## 题目描述 圣诞老人有$n$ 个糖果,他想要把这些作为礼物送给孩子们。 如果圣诞老人想要每个孩子得到的糖果数都是不同的正整数,那他最多能将糖果分给多少个孩子。圣诞老人(Santa Class — 错误的原文)想把他有的$n$ 个糖果都送出去。 ### 输入格式: 仅输入一行一个正整数$n$ ($1\leq n\leq 1000$ ) — 圣诞老人有的糖果数。 ### 输出格式: 输出的第一行为一个整数$k$ — 能得到糖果的孩子的最大数目。 输出第二行为$k$ 个不同的整数:为这$k$ 个孩子各自得到的糖果数。输出的这$k$ 个数的和应为$n$ 。 如果有多种方案,输出其中的任意一种。 感谢@Khassar 提供的翻译

题目描述

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.

输入输出格式

输入格式


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

输出格式


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.

输入输出样例

输入样例 #1

5

输出样例 #1

2
2 3

输入样例 #2

9

输出样例 #2

3
3 5 1

输入样例 #3

2

输出样例 #3

1
2