#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 100;
pair<int, int> y[MAXN];
int f[MAXN], x[MAXN];
int main() {
  int n, q;
  scanf("%d %d", &n, &q);
  for (int i = 0; i < n; i++) {
    cin >> y[i].first;
    y[i].second = i;
  }
  sort(y, y + n);
  for (int i = 0; i < n; i++) {
    f[y[i].second] = i;
  }
  for (int i = 0; i < n; i++) {
    x[i] = y[i].first;
  }
  int a, l;
  for (int i = 0; i < q; i++) {
    scanf("%d %d", &a, &l);
    a--;
    a = f[a];
    bool flag = 1;
    while (flag) {
      int u = upper_bound(x, x + n, x[a] + l) - x;
      u--;
      int k = (x[u] - x[a]);
      int u2 = lower_bound(x, x + n, x[u] - l + k) - x;
      u2 = min(u2, a);
      l -= k;
      if (u2 != a || u != a) {
        int k = x[u] - x[u2];
        l %= 2 * k;
        if (l >= k) {
          l -= k;
          a = u2;
        } else {
          a = u;
        }
        continue;
      }
      flag = 0;
    }
    printf("%d\n", y[a].second + 1);
  }
  return 0;
}
