#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
ostream& operator<<(ostream& o, const pair<T, U>& v) {
  return o << "(" << v.first << ", " << v.second << ")";
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& v) {
  o << "{";
  for (int i = 0; i < (int)((int)((v).size())); ++i)
    o << (i ? ", " : "") << v[i];
  return o << "}";
}
template <class T, class U>
ostream& operator<<(ostream& o, const map<T, U>& v) {
  o << "{";
  for (const auto& e : v) o << e << ", ";
  return o << "}";
}
template <class T>
ostream& operator<<(ostream& o, const set<T>& v) {
  o << "{";
  for (const auto& e : v) o << e << ", ";
  return o << "}";
}
template <class T>
string to_s(const T& v) {
  ostringstream is;
  is << v;
  return is.str();
}
const int dx[] = {0, -1, 0, 1};
const int dy[] = {-1, 0, 1, 0};
int main(int argc, char* argv[]) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<pair<long long, long long> > peg(n);
  for (int i = 0; i < (int)(n); ++i) cin >> peg[i].first;
  for (int i = 0; i < (int)(n); ++i) peg[i].second = i;
  auto cp = peg;
  sort((peg).begin(), (peg).end());
  for (int iii = 0; iii < (int)(m); ++iii) {
    long long a, l;
    cin >> a >> l;
    --a;
    long long sx = cp[a].first;
    map<long long, int> app[2];
    int dir = 0;
    int ans = a;
    while (true) {
      if (app[dir].count(sx)) {
        if (app[dir][sx] == l) break;
        l %= app[dir][sx] - l;
      }
      app[dir][sx] = l;
      if (dir == 0) {
        int idx = upper_bound((peg).begin(), (peg).end(),
                              make_pair(sx + l, 1LL << 60LL)) -
                  peg.begin() - 1;
        l -= abs(peg[idx].first - sx);
        ans = peg[idx].second;
        sx = peg[idx].first;
      } else {
        int idx = lower_bound((peg).begin(), (peg).end(),
                              make_pair(sx - l, (long long)-1)) -
                  peg.begin();
        l -= abs(peg[idx].first - sx);
        ans = peg[idx].second;
        sx = peg[idx].first;
      }
      dir = !dir;
    }
    cout << ans + 1 << '\n';
  }
}
