Agents can open pull requests faster than humans can review them. Simulate the review queue day by day.
Input: first line days reviewCapacity wipLimit. Second line: days integers — the number of PRs agents want to open on each day.
Each day, in this order:
- Arrivals: if
wipLimitis0(no limit), all wanted PRs are added to the queue; otherwise agents may add PRs only while the queue is belowwipLimit(so at mostwipLimit - queueare added; the others are not created that day). - Reviews: humans review up to
reviewCapacityPRs from the front of the queue (oldest first). Each reviewed PR's waiting time istoday - arrivalDay(0 if reviewed on the day it arrived).
Print for each day Day d: +added (wanted w), reviewed r, queue q. At the end print:
Reviewed: R, Still waiting: S
Average wait: x.xx days
Max queue: M
(average over reviewed PRs, two decimals; 0.00 if none; the maximum queue is the largest queue size measured right after the arrivals of a day).
Input:
5 10 0
30 30 30 5 5
Output:
Day 1: +30 (wanted 30), reviewed 10, queue 20
Day 2: +30 (wanted 30), reviewed 10, queue 40
Day 3: +30 (wanted 30), reviewed 10, queue 60
Day 4: +5 (wanted 5), reviewed 10, queue 55
Day 5: +5 (wanted 5), reviewed 10, queue 50
Reviewed: 50, Still waiting: 50
Average wait: 1.60 days
Max queue: 70