#P10285. [USACO24OPEN] Activating Robots P
[USACO24OPEN] Activating Robots P
题目描述
You and a single robot are initially at point on a circle with perimeter (). You can move either counterclockwise or clockwise along the circle at unit per second. All movement in this problem is continuous.
Your goal is to place exactly robots such that at the end, every two consecutive robots are spaced away from each other (, divides ). There are () activation points, the th of which is located distance counterclockwise from (). 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 unit per seconds ().
Compute the minimum time required to achieve the goal.
输入格式
The first line contains , , , and .
The next line contains space-separated integers .
输出格式
The minimum time required to achieve the goal.
10 2 1 2
6
22
10 2 1 2
7
4
32 4 5 2
0 23 12 5 11
48
24 3 1 2
16
48
提示
For Sample 1:
We can reach the activation point at in seconds by going clockwise. At this time, the initial robot will be located at . Wait an additional seconds until the initial robot is located at . Now we can place a robot to immediately win.
For Sample 2:
We can reach the activation point at in seconds by going clockwise. At this time, the initial robot will be located at . Wait an additional second until the initial robot is located at . Now we can place a robot to immediately win.
SCORING:
- Inputs 5-6: .
- Inputs 7-12: .
- Inputs 13-20: .
- Inputs 21-24: No additional constraints.