SP2826 RRSCHED - Round-Robin Scheduling
Description
A computer processor is given N tasks to perform (1 ≤ N ≤ 50,000). The i-th task requires T $ _{i} $ seconds of processing time (1 ≤ T $ _{i} $ ≤ 1,000,000,000). The processor runs the tasks as follows: each task is run in order, from 1 to N, for 1 second, and then the processor repeats this again starting from task 1. Once a task has been completed, it will not be run in later iterations. Determine, for each task, the total running time elapsed once the task has been completed.
Input Format
The first line of the input contains the integer N, and the next N lines contain the integers T $ _{1} $ through T $ _{N} $ .
Output Format
Output N lines, the i-th of which contains an integer representing the time elapsed when task i has been processed.