Activating Robots
시간 제한5초메모리 제한1024 MB
먼저 놓인 로봇들이 반시계 방향으로 계속 움직이는 원 위에서 활성화 지점에 도달해 R-1개의 로봇을 정확히 L/R 간격으로 배치하는 최소 시간을 구한다.
문제
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.