#include <bits/stdc++.h>
using namespace std;
inline int getint() {
  char c;
  while ((c = getchar()) < '0' || c > '9')
    ;
  return c - '0';
}
int a[200005], n, c[200005], flip;
pair<int, int> b[200005];
int fun(int pos, int len, int dir) {
  int tl, t1, temp, temp2;
  if (len == 0) {
    return b[pos].second;
  }
  if (dir == 0) {
    temp = upper_bound(a + 1, a + n + 1, a[pos] + len) - (a);
    temp--;
    if (temp == pos && flip == 1) {
      return b[pos].second;
    } else if (temp == pos) {
      flip++;
      return fun(pos, len, dir ^ 1);
    }
    tl = len - (a[temp] - a[pos]);
    temp2 = lower_bound(a + 1, a + n + 1, a[temp] - tl) - (a);
    if (temp2 == pos) {
      tl = (a[temp] - a[pos]);
      t1 = len / tl;
      if (t1 & 1) {
        return fun(temp, len % tl, 1);
      } else {
        return fun(pos, len % tl, 0);
      }
    } else {
      return fun(temp, len - (a[temp] - a[pos]), 1);
    }
  } else {
    temp = lower_bound(a + 1, a + n + 1, a[pos] - len) - (a);
    if (temp == pos && flip == 1) {
      return b[pos].second;
    } else if (temp == pos) {
      flip++;
      return fun(pos, len, dir ^ 1);
    }
    tl = len - (a[pos] - a[temp]);
    temp2 = upper_bound(a + 1, a + n + 1, a[temp] + tl) - (a);
    temp2--;
    if (temp2 == pos) {
      tl = (a[pos] - a[temp]);
      t1 = len / tl;
      if (t1 & 1) {
        return fun(temp, len % tl, 0);
      } else {
        return fun(pos, len % tl, 1);
      }
    } else {
      return fun(temp, len - (a[pos] - a[temp]), 0);
    }
  }
}
int main() {
  int m, i, pos, l, ans;
  scanf("%d %d", &n, &m);
  b[0].first = -1000000005;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    c[i] = a[i];
    b[i].first = a[i];
    b[i].second = i;
  }
  sort(b, b + n + 1);
  for (i = 0; i <= n; i++) {
    a[i] = b[i].first;
  }
  for (i = 0; i < m; i++) {
    scanf("%d %d", &pos, &l);
    flip = 0;
    pos = lower_bound(a + 1, a + n + 1, c[pos]) - a;
    ans = fun(pos, l, 0);
    printf("%d\n", ans);
  }
  return 0;
}
