Logo
(追記) (追記ここまで)

19425번 - Line Counting 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB5420929.032%

문제

Bobo has a set $P$ of $\displaystyle\frac{n(n + 1)}{2}$ points: $\{ (x, y) : 1 \leq x \leq y \leq n, \ x, y \in \mathbb{Z} \}$. He would like to know the number of distinct lines passing through at least two points in $P,ドル taken modulo $(10^9+7)$.

입력

The input contains zero or more test cases, and is terminated by end-of-file.

Each test case is a single line containing an integer $n$ (2ドル \leq n \leq 2 \cdot 10^9$).

It is guaranteed that the number of test cases does not exceed 10ドル^5,ドル and the sum of all $n$ does not exceed 2ドル \cdot 10^9$.

출력

For each test case, output an integer which denotes the number of distinct lines.

제한

예제 입력 1

2
3
5

예제 출력 1

3
9
51

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2017 > Day 9. Xi Lin Contest, Grand Prix of China D번

Contest > Open Cup > 2016/2017 Season > Stage 11: Grand Prix of China D번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /