#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 3;
const long long inf = 1e15 + 3;
vector<array<long long, 3> > it[4 * N];
long long ar[N], x, s;
void build(long long idx, long long l, long long r) {
  if (l == r) {
    it[idx].push_back({0, (ar[l] - ar[l - 1] + l - 1) / l,
                       (ar[l] - ar[l - 1] + l - 1) / l * l});
    if ((ar[l] - ar[l - 1]) % l) {
      it[idx].push_back({(ar[l] - ar[l - 1]) % l, (ar[l] - ar[l - 1]) / l,
                         (ar[l] - ar[l - 1]) / l * l});
    }
    it[idx].push_back({l});
    return;
  }
  long long mid = (l + r) / 2;
  build(2 * idx, l, mid);
  build(2 * idx + 1, mid + 1, r);
  for (long long i = 0; i + 1 < it[2 * idx].size(); i++) {
    long long lef = ar[l - 1] + it[2 * idx][i][0] + it[2 * idx][i][2] - ar[mid],
              rig = ar[l - 1] + it[2 * idx][i + 1][0] + it[2 * idx][i][2] -
                    ar[mid];
    long long j = upper_bound(it[2 * idx + 1].begin(), it[2 * idx + 1].end(),
                              array<long long, 3>{lef, inf + 1, inf + 1}) -
                  it[2 * idx + 1].begin() - 1;
    for (; j + 1 < it[2 * idx + 1].size(); j++) {
      if (it[2 * idx + 1][j][0] >= rig) {
        break;
      }
      it[idx].push_back(
          {it[2 * idx][i][0] + max(0ll, it[2 * idx + 1][j][0] - lef),
           it[2 * idx][i][1] + it[2 * idx + 1][j][1],
           it[2 * idx][i][2] + it[2 * idx + 1][j][2]});
    }
  }
  it[idx].push_back({l});
}
void query(long long idx, long long l, long long r, long long pos) {
  if (r < pos || x < ar[l - 1]) {
    return;
  }
  long long j =
      upper_bound(it[idx].begin(), it[idx].end(),
                  array<long long, 3>{x - ar[l - 1], inf + 1, inf + 1}) -
      it[idx].begin() - 1;
  if (l >= pos && s >= it[idx][j][1]) {
    assert(j >= 0 && j < it[idx].size());
    s -= it[idx][j][1];
    x += it[idx][j][2];
    return;
  }
  if (l == r) {
    x += s * l;
    s = 0;
    return;
  }
  query(2 * idx, l, (l + r) / 2, pos);
  query(2 * idx + 1, (l + r) / 2 + 1, r, pos);
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, m, i, j, k, l, q;
  cin >> n >> q;
  for (i = 0; i < n; i++) {
    cin >> ar[i];
    ar[i] -= i;
  }
  ar[n] = inf;
  build(1, 1, n);
  for (i = 1; i <= q; i++) {
    cin >> x >> s;
    l = upper_bound(ar, ar + n, x) - ar;
    if (l) {
      s += (x - ar[l - 1]) / l;
      x -= (x - ar[l - 1]) / l * l;
      query(1, 1, n, l);
    }
    cout << x << '\n';
  }
}
