#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f3f3f3f3fLL;
int n, q;
vector<int> pins;
set<long long> pins_set;
map<long long, int> pins_mp;
int do_solve(long long pos, long long len, int dir, int step) {
  assert(len >= 0);
  if (len == 0) {
    return pos;
  }
  long long l = pos - len;
  long long r = pos + len;
  long long ll = *pins_set.lower_bound(l);
  long long rr = *(--pins_set.upper_bound(r));
  if (ll >= pos) {
    ll = INF;
  }
  if (rr <= pos) {
    rr = INF;
  }
  if (rr != INF) {
    if (step != 0) {
      len %= (rr - pos) * 2;
    }
    if (len >= (rr - pos)) {
      len -= (rr - pos);
      return do_solve(rr, len, -dir, step + 1);
    } else {
      assert(step != 0);
      return do_solve(pos, len, dir, step + 1);
    }
  }
  if (ll != INF) {
    if (step != 0) {
      len %= (pos - ll) * 2;
    }
    if (len >= (pos - ll)) {
      len -= (pos - ll);
      return do_solve(ll, len, -dir, step + 1);
    } else {
      assert(step != 0);
      return do_solve(pos, len, dir, step + 1);
    }
  }
  return pos;
}
int solve(int pos, int len) { return do_solve(pos, len, +1, 0); }
int main() {
  cin >> n >> q;
  pins.resize(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &pins[i]);
    pins_set.insert(pins[i]);
    pins_mp[pins[i]] = i;
  }
  int pos, len;
  while (q--) {
    scanf("%d%d", &pos, &len);
    int ans = solve(pins[pos - 1], len);
    printf("%d\n", pins_mp[ans] + 1);
  }
  return 0;
}
