#include <bits/stdc++.h>
using namespace std;
const long long MXN = 2e5 + 10;
const long long INF = 1e14;
long long n, q;
long long X[MXN], Cop[MXN];
map<long long, long long> mp;
long long Solve(long long x, long long len) {
  long long r = X[upper_bound(X, X + n + 2, x + len) - X - 1];
  long long rem = len - (r - x);
  long long l = X[lower_bound(X, X + n + 2, r - rem) - X];
  if (l == r) return l;
  long long t = r - l, q, nxt;
  len -= (r - x);
  q = len / t;
  if (q % 2 == 0)
    nxt = r;
  else
    nxt = l;
  return Solve(nxt, len % t);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> q;
  for (int i = 1; i <= n; i++) cin >> X[i], Cop[i] = X[i], mp[X[i]] = i;
  X[0] = -INF, X[n + 1] = INF;
  sort(X, X + n + 2);
  while (q--) {
    long long id, l;
    cin >> id >> l;
    cout << mp[Solve(Cop[id], l)] << '\n';
  }
  return 0;
}
