C1737 [CEOI2018Day2] Toys

内存限制:256 MB 时间限制:5000 ms

题目描述

Johnny collects toys. His collection may contain many toys of many different types: cars, trucks, diggers and many more. He may own more than one piece of the same toy, e.g. four trucks, in which case all the pieces are indistinguishable for him.

Emma asked Johnny how many toys he has. Not wanting to reveal the secret, he answered with a riddle (it is typical for him): If I chose a different set of my toys for each day, I could play for n days. In other words, for every two days there is a type of toy with a different quantity. Here, Johnny considers an empty set of toys as a valid set.

Emma likes neither the answer and nor this riddle, but she is really curious to know how many toys Johnny has. She asked you for help. Can you determine all possibilities of the number of toys that Johnny may have in his collection?

输入格式

The first (and the only one) line of the standard input contains an integer $n (1 ≤ n ≤ 10^9)$.

输出

The first line of the standard output should contain one integer $r$, the number of solutions (that is, the number of possibilities of the number of toys in Johnny’s collection).

The second line should contain a strictly increasing sequence of $r$ integers that represents the numbers of toys that Johnny may have in his collection.

样例

样例输入 1

12

样例输出 1

4 4 5 6 11

样例输入 2

36

样例输出 2

8 6 7 8 10 11 13 18 35

提示

Grading

The test set is divided into the following subtasks with additional constraints. Tests in each of the subtasks consist of one or more separate test groups. Each test group may contain one or more test cases.

image.png