cswork / OA打开练习工作台

ZipRecruiterOA #9

Exclusive Event Entry

估计中等可在线判题

考点(AI 标注)模拟/实现

Guests arrive in non-decreasing order. An ID check takes 300 seconds. The guest currently being checked is not counted in the waiting queue; if, on arrival, the number of waiting guests is already greater than 10, the guest leaves and their arrival time is output. If a guest arrives at the same moment a check finishes, the guests already waiting start their check first, and the new guest joins the end of the queue. Output each guest's completion time; for guests who leave, output their arrival time.

输入格式

The first line contains n (1..5000); the second line contains n non-decreasing non-negative integer arrival times (≤10^9).

输出格式

Output n space-separated integers in arrival order.

样例 1

输入:

4
4 400 450 500

输出:

304 700 1000 1300

样例 2

输入:

15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

输出:

301 601 901 1201 1501 1801 2101 2401 2701 3001 3301 3601 13 14 15

样例 3

输入:

3
0 1 300

输出:

300 600 900