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

27184번 - Campfire Riddle 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB26211789.474%

문제

One day Yurik found himself in a forest near the campfire where $n$ people had gathered.

It turned out that some of them are friends. Let's number all people with integers from 1ドル$ to $n$. Let's denote the number of people that are friends with the $i$-th person, as $d_i$. It suddenly turned out that two people with numbers $i$ and $j$ ($i \ne j$) are friends if and only if $d_i = d_j$.

When Yurik came home he got curious, what is the minimum number of pairs of people that could be friends, so that the condition described above to be satisfied?

입력

The only line contains one integer $n$ (1ドル \le n \le 5,000円$) --- the number of people.

출력

Print one integer --- the minimum number of pairs of friends.

제한

예제 입력 1

4

예제 출력 1

3

예제 입력 2

5

예제 출력 2

4

노트

Consider the first example. All possible cases are described below:

  1. Each two people are friends with each other. In this case the number of pairs of friends is $\frac{4 \cdot 3}{2} = 6$.
  2. Three people are pairwise friends with each other, and the fourth person is not friend with anyone. In this case the number of pairs of friends is 3ドル$.

출처

Olympiad > Russian Olympiad in Informatics > Russia High School Programming Contest > Russia High School Programming Contest 2022 C번

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

출처

대학교 대회

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

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