5 3 1 3 2 2 5 1 4 4 -3
After the three updates, the five final values are 2 3 3 -2 1.
2 3 3 -2 1
1 2 1 1 7 1 1 -2
The only position receives 7 and then -2, leaving 5.
5
6 4 1 6 10 2 2 -5 3 5 4 6 6 -10
Combining the four updates gives final values 10 5 14 14 14 0.
10 5 14 14 14 0
Given an array of nnn zeros, apply qqq inclusive range additions. After all updates, print the final array.