Powerful Array

You are given an array A of N integers . Now you have to process Q queries in this array. Each query is represented by two number id and K. You have to perform some operations for each query . Each operation is changes id to A[id]+K+id which take t time to do it. There operations are applied until id becomes greater than n. In each query you have to print the total time is being taken to perform all operation in each query.

This is a companion discussion topic for the original entry at https://toph.co/p/powerful-array