#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 24;
int n, m;
int pos[maxn];
pair<int, int> x[maxn];
int dis(int fi, int se) { return abs(x[fi].first - x[se].first); }
int get_next(int id, bool direc, int len) {
  if (direc == 0) {
    int l = id, r = n + 1;
    while (r - l > 1) {
      int mid = (l + r) / 2;
      if (dis(mid, id) <= len) {
        l = mid;
      } else {
        r = mid;
      }
    }
    return l;
  }
  int l = 0, r = id;
  while (r - l > 1) {
    int mid = (l + r) / 2;
    if (dis(mid, id) <= len) {
      r = mid;
    } else {
      l = mid;
    }
  }
  return r;
}
int solve(int id, bool direc, int len) {
  int nex = get_next(id, direc, len);
  if (nex == id) return x[id].second;
  int disd = dis(id, nex);
  if ((len / disd) % 2 == 1) return solve(nex, direc ^ 1, len % disd);
  return solve(id, direc, len % disd);
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    int x1;
    cin >> x1;
    x[i].first = x1;
    x[i].second = i;
  }
  sort(x + 1, x + n + 1);
  for (int i = 1; i <= n; i++) {
    pos[x[i].second] = i;
  }
  for (int i = 0; i < m; i++) {
    int id, l;
    cin >> id >> l;
    id = pos[id];
    int nex = get_next(id, 0, l);
    cout << solve(nex, 1, l - dis(id, nex)) << endl;
  }
}
