#include <bits/stdc++.h>
using namespace std;
inline int get_int() {
  int res, c, t = 1;
  while (!isdigit(c = getchar()))
    if (c == '-') t = -1;
  for (res = c - '0'; isdigit(c = getchar());) res = res * 10 + c - '0';
  return res * t;
}
const int MAXN = 200000;
int n, m;
int val[MAXN + 10];
pair<int, int> pos[MAXN + 10];
int sa[MAXN + 10];
void Read_input() {
  n = get_int();
  m = get_int();
  for (int i = 1; i <= n; i++) {
    val[i] = get_int();
    pos[i] = pair<int, int>(val[i], i);
  }
  sort(pos + 1, pos + n + 1);
  for (int i = 1; i <= n; i++) {
    sa[pos[i].second] = i;
  }
}
inline int abs(int x) { return x > 0 ? x : -x; }
inline int dist(int p1, int p2) { return abs(pos[p1].first - pos[p2].first); }
int rSearch(int len, int st, int ed = n) {
  int L = st, H = ed;
  while (L < H) {
    int M = L + H + 1 >> 1;
    if (dist(M, st) > len)
      H = M - 1;
    else
      L = M;
  }
  return L;
}
int lSearch(int len, int ed, int st = 1) {
  int L = st, H = ed;
  while (L < H) {
    int M = L + H >> 1;
    if (dist(ed, M) > len)
      L = M + 1;
    else
      H = M;
  }
  return L;
}
int calc(int len, int p, int dir) {
  while (1) {
    int p1 = lSearch(len, p);
    int p2 = rSearch(len, p);
    if (dir == 1) swap(p1, p2);
    if (p1 != p) {
      len %= (dist(p1, p) * 2);
      if (len >= dist(p1, p)) {
        len -= dist(p1, p);
        p = p1;
        dir = 1 - dir;
      }
    } else if (p2 != p) {
      dir = 1 - dir;
    } else {
      return pos[p].second;
    }
  }
}
void work() {
  while (m--) {
    int p = sa[get_int()];
    int len = get_int();
    int p1 = rSearch(len, p);
    int p2 = lSearch(len, p);
    if (p1 == p && p2 == p) {
      printf("%d\n", pos[p].second);
      continue;
    }
    if (p1 != p)
      printf("%d\n", calc(len - dist(p1, p), p1, 0));
    else
      printf("%d\n", calc(len, p, 1));
  }
}
int main() {
  Read_input();
  work();
  return 0;
}
