Problem list
Log in
#a00020 · CUSTOM

알파카와 반직선

Bronze V 1.0 s 256 MB

알파카는 오늘 수학 공부를 하려고 한다.

그러나 알파카는 기하를 잘 못해서, 평면 위에 점이 $N$개 있을 때 그 점들을 잇는 반직선의 전체 개수를 구하지 못한다.

알파카를 위해 이 문제의 답을 구해 보자.

Input

첫째 줄에 점의 개수 $N$이 주어진다.

Output

첫째 줄에 반직선의 전체 개수를 출력한다.

Constraints

  • $2 \le N \le 100{,}000$

  • $N$은 자연수이다.

Example 1

Input
2
Output
2

Example 2

Input
3
Output
6
Source
CUSTOM by HyunwooAlpaca
Appears in
Not part of a ladder, contest or set yet.
Accepted 15 Submissions 24 Acceptance 92% Solvers 11

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code