#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
int n, m, a[N], ddd;
struct Data {
  int x, y, u, k;
  Data(int _x = 0, int _y = 0, int _u = 0, int _k = 0) {
    x = _x;
    y = _y;
    u = _u;
    k = _k;
  }
  bool operator<(const Data &oth) const { return x < oth.x; }
};
struct SegmentTree {
  vector<Data> d[N * 4];
  void build(int id, int l, int r) {
    if (l == r) {
      int mid = (a[l + 1] - a[l]) % l;
      int k = (a[l + 1] - a[l] + l - 1) / l;
      int u = a[l] + l * k - a[l + 1];
      if (mid == 0) {
        d[id].push_back(Data(0, l - 1, u, k));
      } else {
        d[id].push_back(Data(0, mid - 1, u, k));
        d[id].push_back(Data(mid, l - 1, 0, k - 1));
      }
      return;
    }
    int mid = (l + r) >> 1;
    build(id << 1, l, mid);
    build(id << 1 | 1, mid + 1, r);
    int cur = 0;
    for (Data dat : d[id << 1])
      while (cur <= dat.y) {
        int x = cur;
        int nX = dat.u + (x - dat.x);
        Data nxt = *(--upper_bound(d[id << 1 | 1].begin(), d[id << 1 | 1].end(),
                                   Data(nX)));
        int u = nxt.u + (nX - nxt.x);
        int y = x + min(dat.y - x, nxt.y - nX);
        int k = dat.k + nxt.k;
        d[id].push_back(Data(x, y, u, k));
        cur = y + 1;
      }
  }
  void go(int id, int l, int r, int &x, int &k) {
    ++ddd;
    if (x < a[l] || a[r + 1] <= x) return;
    if (a[l] <= x && x < a[l] + l) {
      int curX = x - a[l];
      assert(curX < l);
      Data dat = *(--upper_bound(d[id].begin(), d[id].end(), Data(curX)));
      if (k >= dat.k) {
        k -= dat.k;
        x = a[r + 1] + dat.u + (curX - dat.x);
        return;
      }
    }
    if (l == r) return;
    int mid = (l + r) >> 1;
    go(id << 1, l, mid, x, k);
    go(id << 1 | 1, mid + 1, r, x, k);
  }
} ST;
int brute(int x, int k) {
  int p = 0;
  while (k--) {
    while (p < n && a[p + 1] <= x) p++;
    x += p;
  }
  return x;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] -= i - 1;
  }
  if (n > 1) ST.build(1, 1, n - 1);
  while (m--) {
    int x, k;
    cin >> x >> k;
    if (x < a[1]) {
      cout << x << '\n';
      continue;
    }
    if (a[n] <= x) {
      cout << x + (long long)n * k << '\n';
      continue;
    }
    int p = upper_bound(a + 1, a + 1 + n, x) - a - 1;
    int c = min(k, (a[p + 1] - x + p - 1) / p);
    x += c * p;
    k -= c;
    if (k == 0) {
      cout << x << '\n';
      continue;
    }
    ST.go(1, 1, n - 1, x, k);
    p = upper_bound(a + 1, a + 1 + n, x) - a - 1;
    cout << x + (long long)k * p << '\n';
  }
  return 0;
}
