#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
const long double EPS = 1e-8;
const long double PI = acos(-1.0);
const int MAXN = 2e5;
pair<int, int> X[MAXN];
int pos[MAXN];
void run() {
  int n, m, i, j, k, l;
  scanf("%d%d", &n, &m);
  for (i = 0; i < n; ++i) {
    scanf("%d", &l);
    X[i] = pair<int, int>(l, i);
  }
  sort(X, X + n);
  for (i = 0; i < n; ++i) pos[X[i].second] = i;
  for (k = 0; k < m; ++k) {
    scanf("%d%d", &i, &l);
    i = pos[i - 1];
    for (j = 0;; j = !j) {
      if ((i == n - 1 || l < X[i + 1].first - X[i].first) &&
          (i == 0 || l < X[i].first - X[i - 1].first))
        break;
      if (j == 0) {
        int ni =
            upper_bound(X, X + n, pair<int, int>(X[i].first + l, MAXN + 1)) -
            X - 1;
        l -= X[ni].first - X[i].first;
        i = ni;
      } else {
        int ni = lower_bound(X, X + n, pair<int, int>(X[i].first - l, -1)) - X;
        l -= X[i].first - X[ni].first;
        if (i != ni) l %= 2 * (X[i].first - X[ni].first);
        i = ni;
      }
    }
    printf("%d\n", X[i].second + 1);
  }
}
int main() {
  run();
  return 0;
}
