#P2728. [USACO3.2] 纺车的轮子 Spinning Wheels
[USACO3.2] 纺车的轮子 Spinning Wheels
Description
This is an integer problem. The wheels do not rotate by non-integer angles like degrees or degrees. For example, a wheel might rotate at degrees per second, or even – degrees per second if it is fast.
All angles in this problem are restricted to degrees. After a wheel rotates through degrees, the next degree is . Each wheel has a fixed rotational speed in seconds, with .
The starting angle of each slot and the slot size (or width) are both integers, measured in degrees. On a single wheel, there is at least one degree between any two slots. The width includes both the starting and ending angles of the slot, i.e., 0 179 covers , totaling angles.
At the starting position (time ), all the starting marks on the wheels are aligned along a straight line. Your program must compute the earliest time when a slot on each wheel aligns with slots on all the other wheels (i.e., a beam of light can pass through five slots, one on each of the five wheels), at any angle.
Input Format
There are five lines in the input, one per wheel.
The first number is the wheel’s rotational speed . The next number is the number of slots , where . The following pairs give the starting angle and width of each slot.
Output Format
Output a single line with one integer, the earliest time when light can pass through all five wheels. If there is no solution, output none.
30 1 0 120
50 1 150 90
60 1 60 90
70 1 180 180
90 1 180 60
9
Hint
Sample explanation:
After seconds, the five sets of slots are , , , , , so a beam can enter from .
Translation from NOCOW.
USACO Training Section 3.2.
Translated by ChatGPT 5
京公网安备 11011102002149号