#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 123;
using LL = long long;
pair<LL, int> x[maxn];
LL fx[maxn];
int n, m;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    int tx;
    scanf("%d", &tx);
    x[i] = {tx, i};
  }
  sort(x + 1, x + n + 1);
  for (int i = 1; i <= n; ++i) fx[x[i].second] = i;
  for (int i = 0; i < m; ++i) {
    int a, ll;
    scanf("%d%d", &a, &ll);
    LL nd(0), nl(1), nr(n);
    LL l = (ll + x[fx[a]].first - x[1].first);
    while (nl < nr) {
      LL dv(l / (x[nr].first - x[nl].first));
      if (dv & 1) nd = nd ^ 1;
      l %= x[nr].first - x[nl].first;
      if (nd == 0) {
        auto pt(upper_bound(x + nl, x + nr + 1, make_pair(x[nl].first + l, n)) -
                x - 1);
        l -= x[pt].first - x[nl].first;
        nr = pt;
        nd = 1;
      } else {
        auto pt(
            lower_bound(x + nl, x + nr + 1, make_pair(x[nr].first - l, -1)) -
            x);
        l -= x[nr].first - x[pt].first;
        nl = pt;
        nd = 0;
      }
    }
    printf("%d\n", x[nr].second);
  }
  return 0;
}
