#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
int n, k;
struct node {
  int num, id;
  bool operator<(const node &A) const { return num < A.num; }
} a[N];
int b[N];
int Min[N];
void init() {
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) b[a[i].id] = i;
  for (int i = 1; i <= n; i++)
    Min[i] = min(a[i].num - a[i - 1].num, a[i + 1].num - a[i].num);
}
int work(int id, int len) {
  int it1 = upper_bound(a + 1, a + n + 1, (node){a[id].num + len, 0}) - a - 1;
  int len2 = len - abs(a[id].num - a[it1].num);
  int it2 = lower_bound(a + 1, a + n + 1, (node){a[it1].num - len2, 0}) - a;
  if (it1 == it2) return a[it1].id;
  int t = len2 / (a[it1].num - a[it2].num);
  len2 %= (a[it1].num - a[it2].num);
  if (t & 1)
    return work(it2, len2);
  else
    return work(it1, len2);
}
int main() {
  n = read();
  k = read();
  for (int i = 1; i <= n; i++) a[i].id = i, a[i].num = read();
  init();
  while (k--) {
    int id, l;
    id = read();
    l = read();
    printf("%d\n", work(b[id], l));
  }
  return 0;
}
