QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 64 MB Points totaux : 100 Difficulté: [afficher]

#16443. Sky City

Statistiques

In the city of the future, there are many small islands (districts). Now, we want to build some bridges between these islands. Each bridge is a passage between two islands. There is a rule: if there is a bridge between island A and island B, and a bridge between island B and island C, then there cannot be a bridge between island A and island C. That is, for any three islands in the city, it is not allowed to have bridges between all pairs of them. Under this rule, we want to maximize the number of bridges, without needing to consider the specific spatial structure.

Input

The input contains only one line, which contains a single non-negative integer $n$, where $0 \le n \le 1000$, representing the number of islands.

Output

The output contains only one line, representing the maximum number of bridges that can be built.

Examples

Input 1

6

Output 1

9

Input 2

11

Output 2

30

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.