Score : 300 points
Problem Statement
You are given a positive integer N.
Find the number of quadruples of positive integers (A,B,C,D) such that AB+CD=N.
Under the constraints of this problem, it can be proved that the answer is at most 9×1018.
Constraints
- 2≤N≤2×105
- N is an integer.
The input is given from Standard Input in the following format:
N
Output
Print the answer.
4
8
Here are the eight desired quadruples.
- (A,B,C,D)=(1,1,1,3)
- (A,B,C,D)=(1,1,3,1)
- (A,B,C,D)=(1,2,1,2)
- (A,B,C,D)=(1,2,2,1)
- (A,B,C,D)=(1,3,1,1)
- (A,B,C,D)=(2,1,1,2)
- (A,B,C,D)=(2,1,2,1)
- (A,B,C,D)=(3,1,1,1)
292
10886
19876
2219958