#include <bits/stdc++.h>
using namespace std;
pair<int, int> x[200005];
int ans[200005], idx[200005];
int main() {
  int n, m, lef, l, rig;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x[i].first);
    x[i].second = i;
  }
  sort(x, x + n);
  for (int i = 0; i < n; i++) idx[x[i].second] = i;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &lef, &l);
    lef--;
    int j = idx[lef], k = n;
    bool dir = 0;
    while (j < k) {
      if (dir) {
        j = (int)(lower_bound(x, x + k, make_pair(x[k].first - l, 0)) - x);
        l -= (x[k].first - x[j].first);
        k = (int)(upper_bound(x + j, x + n, make_pair(x[j].first + l, n)) - x);
        k--;
        l -= (x[k].first - x[j].first);
      } else {
        k = (int)(upper_bound(x + j, x + n, make_pair(x[j].first + l, n)) - x);
        k--;
        l -= (x[k].first - x[j].first);
        j = (int)(lower_bound(x, x + k, make_pair(x[k].first - l, 0)) - x);
        l -= (x[k].first - x[j].first);
      }
      int diff = (x[k].first - x[j].first);
      if (!diff) break;
      int laps = l / diff;
      l %= diff;
      dir ^= (laps & 1);
    }
    printf("%d\n", x[j].second + 1);
  }
  return 0;
}
