균형 배치 Subtask 5s 1024MB
Problems
You and a single robot are initially at point
Your goal is to place exactly
There are
If you are currently at an activation point, you can instantaneously place a robot at that point. All robots (including the original) move counterclockwise at a rate of
Compute the minimum time required to achieve the goal.
Input
The first line contains
The next line contains
Output
The minimum time required to achieve the goal.
Subtask
| # | Score | Condition |
|---|---|---|
| #1 | 4 | Only the data in the example is given. |
| #2 | 6 | |
| #3 | 20 | |
| #4 | 30 | |
| #5 | 40 | No additional constraints |
Example #1
12 2 1 2
7
26
We can reach the activation point at
Example #2
12 2 1 2
10
8
We can reach the activation point at
Example #3
24 4 5 2
0 15 6 9 18
30