#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
const long long inf = 1e18;
long long x[maxn];
pair<int, int> p[maxn];
int wh[maxn];
int n, m;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &p[i + 1].first);
    p[i + 1].second = i;
  }
  sort(p + 1, p + n + 1);
  for (int i = 0; i <= n + 1; i++) x[i] = p[i].first;
  x[0] = -inf;
  x[n + 1] = inf;
  for (int i = 1; i <= n; i++) wh[p[i].second] = i;
  int k = n + 2;
  for (int i = 0; i < m; i++) {
    int cur, l;
    scanf("%d%d", &cur, &l);
    cur--;
    cur = wh[cur];
    while (l >= x[cur + 1] - x[cur] || l >= x[cur] - x[cur - 1]) {
      int next = upper_bound(x, x + k, x[cur] + l) - x - 1;
      l -= x[next] - x[cur];
      int next2 = lower_bound(x, x + k, x[next] - l) - x;
      l -= x[next] - x[next2];
      if (next2 == cur) {
        l %= 2 * (x[next] - x[cur]);
      }
      cur = next2;
    }
    printf("%d\n", p[cur].second + 1);
  }
  return 0;
}
