Line Counting
Time limit2sMemory limit512 MB
For each n, counts the distinct lines through at least two points of the triangular lattice {(x, y): 1 <= x <= y <= n}, modulo 1000000007.
- Level
Hard9 of 10
- Topics
- Number theory, Geometry, Math
- Solved
- No attempts yet
Problem
Bobo has a set of points: . He would like to know the number of distinct lines passing through at least two points in , taken modulo .
Input
The input contains zero or more test cases and ends at end-of-file.
Each test case is a single line containing an integer ().
The number of test cases does not exceed , and the sum of all does not exceed .
Output
For each test case, output an integer that is the number of distinct lines, taken modulo .