Broken Soundboard

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type
Allowed languages
Assembly, Awk, Brain****, C, C++, Clang, Clang++, D, Haskell, Java, JS, Lua, Mono C#, NASM, NASM64, Perl, TCL, Text, Turing

jsumabat is about to begin his singing career by performing his favorite J-Pop live in front of an audience. There is only one problem however... jsumabat has a terrible singing voice so he prepared a soundboard in order to lip sync his songs. And now he is realizing that the soundboard is broken!

The soundboard has n (1 \le n \le 50000) knobs placed in consecutive order. These knobs each control the decibel value of a certain frequency, which combine to form a perfectly auto-tuned singing voice. The rate at which these knobs change the decibel value is identical. Normally, these knobs act independently from one another, but due to a flaw in manufacturing, whenever jsumabat turns a knob, every other knob after it also gets turned by the same amount!

jsumabat is not aware of this error and turns the knobs as normal. Suffice it to say he is shocked when his performance resulted in an epic failure. Given the amount jsumabat turned each knob by, determine the final position of each knob.

Input Specification

The first line of input will contain n (1 \le n \le 50000) representing the number of knobs on the soundboard. Each knob will have a default turn of 0 decibels.
The next n lines will contain a value, c (0 \le c \le 100) representing the increase in decibels of the n_ith knob. This increase is also applied to every knob after it.

Output Specification

Output on a single line the decibel value of each knob, starting from n_1 to the last knob in order and separated by a space.

Sample input

3
2
7
4

Sample Output

2 9 13

Comments

There are no comments at the moment.