QOJ.ac

QOJ

実行時間制限: 2 s メモリ制限: 1024 MB

#23989. Karuta

統計

Problem Statement

A round-robin karuta tournament with $N$ participating students will be held.

In this tournament, $2$ students participate in every match, and every pair of $2$ distinct students plays against each other in exactly $1$ match.

Find the total number of matches played in the entire tournament.

Constraints

  • $2 \le N \le 100$.
  • $N$ is an integer.

Input

The input is given in the following format:

N

Output

Print the total number of matches played in the entire tournament.

Do not print anything other than the answer. (For example, do not print any text prompting for input.)

For the answer format, you may refer to the practice problems and their sample solutions.

Sample 1

Input

3

Output

3

Let the $3$ participants be A, B, and C. Then, the matches played in the entire tournament are the following $3$ matches:

  • A vs. B
  • A vs. C
  • B vs. C

Sample 2

Input

4

Output

6

Let the $4$ participants be A, B, C, and D. Then, the matches played in the entire tournament are the following $6$ matches:

  • A vs. B
  • A vs. C
  • A vs. D
  • B vs. C
  • B vs. D
  • C vs. D

Sample 3

Input

2

Output

1

Sample 4

Input

100

Output

4950

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.