#include <bits/stdc++.h>
using namespace std;
int n, m, o, re = 0;
long long res = 0;
long long a[1000010], b[1000010];
bool chk[1000010];
map<long long, int> M;
map<long long, int>::iterator it, it2;
int main() {
  int i, j, k, l;
  long long ll = 0, rr = 9223372036854775807LL, mid;
  scanf("%d %d", &n, &m);
  a[0] = -1000000000000037LL;
  a[n + 1] = 1000000000000037LL;
  for (i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    M[a[i]] = i;
  }
  M[a[n + 1]] = n + 1;
  M[a[0]] = 0;
  for (it = M.begin(); it != M.end(); it++) {
    if (it->second == 0 || it->second == n + 1) continue;
    it2 = it;
    it2--;
    b[it->second] = it->first - it2->first;
    it2 = it;
    it2++;
    b[it->second] = min(b[it->second], it2->first - it->first);
  }
  for (i = 0; i < m; i++) {
    scanf("%d %d", &j, &l);
    k = 1;
    while (1) {
      if (l < b[j]) break;
      if (k == 1) {
        it = M.upper_bound(a[j] + l);
        it--;
        l -= it->first - a[j];
        it2 = M.lower_bound(a[it->second] - l);
        if (it2->second == j) {
          bool cc = (l / (it->first - a[j])) & 1;
          l %= it->first - a[j];
          if (cc == 1) continue;
        }
        j = it->second;
      } else {
        it = M.lower_bound(a[j] - l);
        l -= a[j] - it->first;
        it2 = M.upper_bound(a[it->second] + l);
        it2--;
        if (it2->second == j) {
          bool cc = (l / (a[j] - it->first)) & 1;
          l %= it->first - a[j];
          if (cc == 1) continue;
        }
        j = it->second;
      }
      k *= -1;
    }
    printf("%d\n", j);
  }
  return 0;
}
