There was long story in the problem but to put it simply that boils down to this
solve 2 query efficiently
we have score defined for an array as:
score = A[0]*1 + A[1]*2 ....... A[N-1]*N
we have two types of queries
1 i v -> update the value at A[i] = v
2 l r -> find the score of subarray [ A[l] , A[l+1] ,.... A[r] ]