Another Update-Query Problem

You will be given an array A of length N and you will have to perform Q operations on that array. Th...