The request that waits
transcript
A request needs a bay. Every bay is busy. So it waits. When does it end?
The first bay frees at time twenty. The request starts then. It keeps its length of seven. So it ends at twenty-seven.
Using the asked end time is a bug. The bay frees too soon. Later requests start early. The wrong bay wins.
Waiting requests add up. A hundred thousand requests, a billion long each. The last end passes a hundred trillion. Use sixty-four bits.
One wrong end time does not stay small. Each later request inherits the error. The counts of every bay can shift. So the busiest bay changes.
Test with one bay and two requests. The second request waits. Trace both end times by hand. Then compare them with what the code prints.
A waiting request keeps its length. Add it to the time the bay frees. Full breakdown in the lecture.