a = [1, 2, 5, 1, 6]
queries = [(1, 2), (0, 10), (3, 11), (4, 3)]
increments = [0] * len(a)
for position, inc in queries:
    increments[position] += inc
got = list(a)
increments_sum = 0
for i in range(len(increments) - 1, -1, -1):
    increments_sum += increments[i]
got[i] += increments_sum
expected = list(a)
for position, inc in queries:
    for i in range(position + 1):
        expected[i] += inc
print('Expected: ', expected)
print('Got:      ', got)
Increment first n list elements given a condition