#P196. [Sleeping Cup #7] League Preparation
[Sleeping Cup #7] League Preparation
Person in Charge
Attention
The sample cases for this problem are not placed in subtask 0. Instead, they are located elsewhere:
| Sample | Data File | Subtask ID | Test Point |
|---|---|---|---|
| Sample 1 | 3.in / 3.out |
Subtask 2 | #2-1 |
| Sample 2 | 5.in / 5.out |
Subtask 3 | #3-1 |
The subtask dependencies are as follows:
| Subtask ID | Depends on |
|---|---|
| Subtask 1 | None |
| Subtask 2 | Subtask 1 |
| Subtask 3 | Subtask 2 |
| Subtask 4 | Subtask 3 |
File I/O is required (league.in / league.out).
Problem Background
Last time, Sleeping Dolphin's good friend Sleeping Goose lost the match, so they began preparing for the White Goose Planet World Cup years early, hoping to shine then.
To avoid another crushing defeat, the Sleeping Super League was born.
Problem Description
There are teams in the league.
- If , the league uses a single round-robin schedule.
- Otherwise, it uses a double round-robin schedule.
Between any two matches there must be days of rest, and at most one match per day can be held.
Calculate how many days a whole season lasts.
Input Format
Multiple test cases.
First line: an integer , the number of test cases.
For each test case:
One line with a positive integer , the number of teams.
Output Format
For each test case, output one integer: the number of days needed for the season.
Samples
3
1
2
3
0
5
21
3
10
100
1000
357
19797
1997997
Sample 1 Explanation
- With team, no matches can be played: output .
- With teams, matches and are required, scheduled on days and respectively: output .
- With teams, six matches are required: , scheduled on days : output .
Data Range
For of the data, , .
There are four equally-weighted subtasks:
- .
- .
- .
- No additional constraints.
相关
在下列比赛中: