#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const int mod = inf + 7;
const double eps = 1e-9;
const double pi = acos(-1.0);
int m, n, x[200200];
map<int, int> id;
int findlast(int val) {
  int l = 0, r = n - 1;
  int ans = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (x[mid] <= val) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  return ans;
}
int findfirst(int val) {
  int l = 0, r = n - 1;
  int ans = n - 1;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (x[mid] >= val) {
      ans = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  return ans;
}
int go(int ind, int l, int dir) {
  if (l == 0) return ind;
  if ((ind == 0 || x[ind] - l > x[ind - 1]) &&
      (ind + 1 >= n || x[ind] + l < x[ind + 1]))
    return ind;
  if (dir == 1) {
    if (ind > 0 && x[n - 1] - x[ind] <= l)
      return go(n - 1, l - x[n - 1] + x[ind], -1);
    else {
      int j = findlast(x[ind] + l);
      int d = x[j] - x[ind];
      if (ind > 0 && x[j] - x[ind - 1] <= l - d)
        return go(j, l - x[j] + x[ind], -1);
      if (j == ind)
        return go(ind, l, -1);
      else {
        int k = l / d;
        if (k % 2 == 0)
          return go(ind, l - k * d, 1);
        else
          return go(j, l - k * d, -1);
      }
    }
  } else {
    if (ind < n - 1 && x[ind] - x[0] <= l)
      return go(0, l - x[ind] + x[0], 1);
    else {
      int j = findfirst(x[ind] - l);
      int d = x[ind] - x[j];
      if (ind + 1 < n && x[ind + 1] - x[j] <= l - d)
        return go(j, l - x[ind] + x[j], 1);
      if (j == ind)
        return go(ind, l, 1);
      else {
        int k = l / d;
        if (k % 2 == 0)
          return go(ind, l - k * d, -1);
        else
          return go(j, l - k * d, 1);
      }
    }
  }
}
int a[300300];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", x + i);
    id[x[i]] = i;
    a[i] = x[i];
  }
  map<int, int> id2;
  sort(x, x + n);
  for (int i = 0; i < n; i++) id2[x[i]] = i;
  while (m--) {
    int ind, l;
    scanf("%d%d", &ind, &l);
    ind--;
    ind = id2[a[ind]];
    printf("%d\n", id[x[go(ind, l, 1)]] + 1);
  }
  return 0;
}
