eolymp
bolt
Try our new interface for solving problems

"Sum"

It is well known that Mark likes creating mathematical tasks very much. Recently he has invented the following one: for given \textbf{S} find all positive integers \textbf{А} and \textbf{В}, that \textbf{А} ≤ \textbf{В} and \textbf{А + (А + 1) + (А + 2) + … + (В - 1) + В = S}. \InputFile Input contains one integer \textbf{S} (\textbf{1} ≤ \textbf{S} ≤ \textbf{10^12}). \OutputFile First line at output should contain one integer \textbf{K} -- number of pairs that have been found. Each of following \textbf{K} lines should contain \textbf{2} integers, first not greater than second -- corresponding pair. Pairs should be printed sorted ascending by first number.
Time limit 0.5 seconds
Memory limit 256 MiB
Input example #1
22
Output example #1
2
4 7
22 22
Source ACM-ICPC Ukraine 2013, 2nd Stage Ukraine, September 10-12, 2013