401516: GYM100488 C Lost Temple

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

Description

C. Lost Templetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Long time ago Andrew thought up a programming problem. Its main character was Indiana Jones who wanted to get into the temple of the lost ancient civilization but faced with a puzzle. There was a sculpture of a creature stretching out its hands near the temple's entrance, and on the temple's wall there was a suggestion to put into the left and into the right hands of the statue some non-zero amount of coins so that the product of those amounts is exactly k times greater than their sum. Of course if one does it wrong the doors to the temple won't open and nearby traps can kill or hurt Dr. Jones.

Unfortunately, this problem hasn't been given to the contest where Andrew wanted to publish it first. So you should solve it here and now. You should find all the ways to put coins into the sculpture's hands so that the doors to the temple will open.

Input

The only line contains the only integer k (1 ≤ k ≤ 109) — the number of times the product of the coins' amounts must be greater than their sum.

Output

In the first line output a single integer n — the number of different pairs of coins' amounts that open the doors to the temple.

In the each of the next n lines in any order output two integers separated by a space — the amounts of coins to put into the left and into the right hands of the statue, correspondingly. Each pair should be outputted exactly once; pairs that differ only by the order of its elements are considered different.

ExamplesInput
1
Output
1
2 2
Input
2
Output
3
3 6
6 3
4 4

加入题单

算法标签: