#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T abs(T a) {
  return ((a < 0) ? -a : a);
}
template <typename T>
inline T sqr(T a) {
  return a * a;
}
bool solve(int);
int main() {
  cout << fixed << setprecision(10);
  cerr << fixed << setprecision(3);
  int test = 0;
  while (solve(test)) {
    ++test;
  }
  return 0;
}
const int INF = 1e9 + 300;
const int N = 200500;
int n, m;
pair<int, int> a[N];
int idxs[N];
int calc(int i, int len, bool rg) {
  if (rg) {
    int nx =
        int(upper_bound(a, a + n, pair<int, int>(a[i].first + len, INF)) - a) -
        1;
    assert(nx >= i);
    return calc(nx, len - (a[nx].first - a[i].first), false);
  } else {
    int nx =
        int(lower_bound(a, a + n, pair<int, int>(a[i].first - len, 0)) - a);
    assert(nx <= i);
    if (i == nx) return i;
    int curLn = a[i].first - a[nx].first;
    int cnt = len / curLn;
    if (cnt & 1) {
      return calc(nx, len - cnt * curLn, true);
    } else {
      return calc(i, len - cnt * curLn, false);
    }
  }
}
bool solve(int) {
  if (scanf("%d%d", &n, &m) != 2) return false;
  for (int i = int(0); i < int(n); ++i) {
    assert(scanf("%d", &a[i].first) == 1);
    a[i].second = i;
  }
  sort(a, a + n);
  for (int i = int(0); i < int(n); ++i) idxs[a[i].second] = i;
  for (int i = int(0); i < int(m); ++i) {
    int idx, len;
    assert(scanf("%d%d", &idx, &len) == 2);
    idx = idxs[idx - 1];
    printf("%d\n", a[calc(idx, len, true)].second + 1);
  }
  return true;
}
