#P4388. 付公主的矩形

    ID: 3289 远端评测题 350ms 125MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>枚举,暴力素数判断,质数,筛法最大公约数,gcd

付公主的矩形

Description

To vent her anger, she made a large number of scarecrows. Every day, Princess Fu arranges some scarecrows into an RC R*C rectangle, with one scarecrow on each cell of the grid. Then she stands at the top-left corner and shoots an arrow toward the bottom-right corner of the rectangle. Princess Fu is an excellent archer; she can pierce through any number of scarecrows. Any scarecrow on a cell that the arrow passes through is destroyed. Seeing the ruined scarecrows makes Princess Fu a little happier.

However, making scarecrows costs a lot of money, so Princess Fu does not want to destroy too many scarecrows. Therefore, each day she chooses to destroy exactly N N scarecrows. Princess Fu is also fickle; she wants to see a different rectangle arrangement each day. Rectangles are considered up to rotation, i.e., R×C R\times C and C×R C\times R are equivalent. She easily computed the number of arrangements, and decided to make things difficult for you. Unwilling to admit defeat, you decide to write a program to compute this number and submit it as your answer to Princess Fu.

Input Format

The input consists of a single line with one integer N N (1N106 1\le N\le 10^6 ), representing the number of scarecrows destroyed each time.

Output Format

Output a single integer representing the total number of arrangements.

4
4

Hint

Sample explanation:

For 40% 40\% of the testdata, 1N104 1 \le N \le 10^4 .

For 100% 100\% of the testdata, 1N106 1 \le N \le 10^6 .

Translated by ChatGPT 5