#K39482. Item Completion Times
Item Completion Times
Item Completion Times
You are given a list of stages, where each stage takes a certain number of seconds to complete. Your task is to calculate the cumulative completion time for each stage. Specifically, if you are given stage times \(t_1, t_2, \ldots, t_n\), you must compute the sequence:
[ F_i = \sum_{j=1}^{i} t_j, \quad \text{for } i=1,2,\ldots,n. ]
For example, if the input stages are [2, 3, 5], the output should be [2, 5, 10] because:
- After stage 1: 2 seconds
- After stage 2: 2 + 3 = 5 seconds
- After stage 3: 2 + 3 + 5 = 10 seconds
Read the input from standard input (stdin) and write the result to standard output (stdout) in the format specified in the input/output sections.
inputFormat
The first line contains a single integer \(n\) representing the number of stages. The second line contains \(n\) space-separated integers, where the \(i\)-th integer represents the time taken for the \(i\)-th stage in seconds.
outputFormat
Print \(n\) space-separated integers representing the cumulative completion times for each stage.
## sample3
2 3 5
2 5 10