A is an array containing at most 105 integers.
We have to do 2 kinds of operations on this array in log(N) complexity (where, N= number of elements in A).
Operation 1, given v,i,j we have to add v to A[k] (i<=k<=j).
Operation 2, given i & j calculate ( A[i] * A[i+1] * A[i+2] * .... * A[j] ) % M. (M is a prime, and will be same for all operations).
There will be almost 105 operations to be made.
If it's not possible in log(N), then what is the best possible complexity to do the operations?