407424: GYM102788 B Rectangles

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

B. Rectanglestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Imagine rectangles drawn on a piece of squared paper, their sides matching the lines of the grid. In such case, the cells within a rectangle are either external if they are adjacent to the sides (marked black in the figure below) or internal if they are not attached to the sides (marked grey in the figure).

Calculate how many rectangles there are with the number of external cells exactly $$$n$$$ times smaller than the number of internal cells. Print the sizes of all appropriate rectangles in the ascending order based on the length of the smaller side.

Input

The input file contains a single positive integer $$$n$$$ ($$$1 \le n \le 10^9$$$).

Output

In the first output line, print $$$k$$$ — the number of rectangles meeting the above criterion. The next $$$k$$$ lines must contain pairs of numbers representing the sides of appropriate rectangles (first the smaller side then the biggest one) in the ascending order based on the length of the smaller side.

ExamplesInput
1
Output
2
5 12
6 8
Input
2
Output
4
7 30
8 18
9 14
10 12

加入题单

算法标签: