eolymp
bolt
Try our new interface for solving problems
Problems

Excursion

Excursion

Tours led by Ivan Petrovich are always very organized. Ivan Petrovich especially like the building in a square, as if a student fall behind the group, its absence in the square is more noticeable than when using the building in the form of rows and columns by one. Therefore, students are divided into several groups, which can be built in a square. To different groups were easily distinguishable visually, requires that different groups had different numbers of schoolchildren. Of the \textbf{100} pupils can make one group of\textbf{10}×\textbf{10}, or two groups of \textbf{6}×\textbf{6} and \textbf{8}×\textbf{8}, but better in terms of Ivan Petrovich to make \textbf{5} groups of \textbf{1}×\textbf{1}, \textbf{3}×\textbf{3}, \textbf{4}×\textbf{4}, \textbf{5}×\textbf{5} and \textbf{7}×\textbf{7}. Write a program that finds a partition of \textbf{N} students into groups in the form of squares, among which no two are identical in number. The number of groups in the partition must be as much as possible. \InputFile In the first line of input contains one integer \textbf{N} (\textbf{1}  ≤ \textit{ }\textbf{N}  ≤  \textbf{10^5}) -- the number of students going to the tour. \OutputFile If the partition is found, then withdraw in the first line the number of groups in the partition, and the second line - in order of size of square groups. If there are multiple partitions with a maximum number of groups that bring minimum in lexicographical order. If the partition does not exist in the first line of output \textbf{0}.
Time limit 2 seconds
Memory limit 64 MiB
Input example #1
1
Output example #1
1
1