#include <bits/stdc++.h>
std::mt19937 rng(std::chrono::system_clock::now().time_since_epoch().count());
struct Treap {
  int priority;
  int64_t pos, pos_lazy;
  int life, life_min, life_lazy;
  int size;
  struct Treap *left, *right;
  int id;
  static struct Treap* nil;
  Treap()
      : priority(-1),
        pos(0),
        pos_lazy(0),
        life(1e9 + 7),
        life_min(1e9 + 7),
        life_lazy(0),
        size(0),
        left(nil),
        right(nil),
        id(-1) {}
  Treap(int64_t pos, int life, int id)
      : priority(std::uniform_int_distribution<int>(0, INT_MAX)(rng)),
        pos(pos),
        pos_lazy(0),
        life(life),
        life_min(life),
        life_lazy(0),
        size(1),
        left(nil),
        right(nil),
        id(id) {}
  void pull() {
    if (this != nil) {
      left->push();
      right->push();
      size = left->size + right->size + 1;
      life_min = std::min(life, std::min(left->life_min, right->life_min));
    }
  }
  void push() {
    if (this != nil) {
      left->pos_lazy += pos_lazy;
      right->pos_lazy += pos_lazy;
      pos += pos_lazy;
      pos_lazy = 0;
      left->life_lazy += life_lazy;
      right->life_lazy += life_lazy;
      life_min += life_lazy;
      life += life_lazy;
      life_lazy = 0;
    }
  }
  static void dump(struct Treap* x) {
    x->push();
    if (x != nil) {
      printf("[");
      dump(x->left);
      printf("%I64d:%d", x->pos, x->life);
      dump(x->right);
      printf("]");
    }
  }
  static void split(struct Treap* x, int k, struct Treap*& L,
                    struct Treap*& R) {
    assert(k >= 0 && k <= x->size);
    x->push();
    L = R = nil;
    if (x == nil) return;
    if (k <= x->left->size) {
      split(x->left, k, L, x->left);
      R = x;
    } else {
      split(x->right, k - x->left->size - 1, x->right, R);
      L = x;
    }
    x->pull();
  }
  static struct Treap* concat(struct Treap* x, struct Treap* y) {
    x->push();
    y->push();
    if (x == nil) return y;
    if (y == nil) return x;
    if (x->priority > y->priority) {
      x->right = concat(x->right, y);
      x->pull();
      return x;
    } else {
      y->left = concat(x, y->left);
      y->pull();
      return y;
    }
  }
  static int lower_bound(struct Treap* x, int64_t pos) {
    x->push();
    if (x == nil) return 0;
    if (pos <= x->pos) {
      return lower_bound(x->left, pos);
    } else {
      return lower_bound(x->right, pos) + x->left->size + 1;
    }
  }
  static int upper_bound(struct Treap* x, int64_t pos) {
    x->push();
    if (x == nil) return 0;
    if (pos < x->pos) {
      return upper_bound(x->left, pos);
    } else {
      return upper_bound(x->right, pos) + x->left->size + 1;
    }
  }
  static int argmin_life(struct Treap* x) {
    if (x == nil) return 0;
    x->push();
    x->left->push();
    x->right->push();
    if (x->left != nil && x->life_min == x->left->life_min) {
      return argmin_life(x->left);
    } else if (x->life_min == x->life) {
      return x->left->size;
    } else if (x->right != nil && x->life_min == x->right->life_min) {
      return argmin_life(x->right) + x->left->size + 1;
    } else {
      assert(false);
    }
  }
  static struct Treap* kth(struct Treap* x, int k) {
    assert(k >= 0 && k < x->size);
    x->push();
    if (k < x->left->size) {
      return kth(x->left, k);
    } else if (k > x->left->size) {
      return kth(x->right, k - x->left->size - 1);
    } else {
      return x;
    }
  }
  static struct Treap* merge(struct Treap* x, struct Treap* y) {
    struct Treap* res = nil;
    while (true) {
      if (x == nil) return concat(res, y);
      if (y == nil) return concat(res, x);
      if (kth(x, 0)->pos > kth(y, 0)->pos) {
        std::swap(x, y);
      }
      int k = upper_bound(x, kth(y, 0)->pos);
      assert(k > 0);
      struct Treap* L;
      split(x, k, L, x);
      res = concat(res, L);
    }
  }
};
struct Treap* Treap::nil = new Treap();
int64_t holes[100005];
int64_t ans[100005];
int main() {
  int N, Q;
  scanf("%d %d", &N, &Q);
  for (int i = 0; i < N; i++) {
    scanf("%I64d", &holes[i]);
  }
  struct Treap* curr = Treap::nil;
  for (int i = 0; i < Q; i++) {
    int X, K;
    scanf("%d %d", &X, &K);
    if (X < holes[0]) {
      ans[i] = X;
    } else {
      curr = Treap::merge(curr, new Treap(X, K, i));
    }
  }
  holes[N] = 1e18;
  for (int i = 1; i <= N; i++) {
    struct Treap* next = Treap::nil;
    {
      int k = Treap::lower_bound(curr, holes[i]);
      struct Treap* eject;
      Treap::split(curr, k, curr, eject);
      next = Treap::merge(next, eject);
    }
    while (curr != Treap::nil) {
      int64_t moves = std::min<int64_t>(
          curr->life_min,
          (holes[i] - Treap::kth(curr, curr->size - 1)->pos + i - 1) / i);
      curr->pos_lazy += moves * i;
      curr->life_lazy -= moves;
      curr->push();
      {
        int k = Treap::lower_bound(curr, holes[i]);
        struct Treap* eject;
        Treap::split(curr, k, curr, eject);
        if (eject != Treap::nil) {
          eject->pos_lazy -= i;
          eject->life_lazy++;
          eject->push();
          next = Treap::merge(next, eject);
        }
      }
      if (curr == Treap::nil) break;
      if (curr->life_min == 0) {
        int k = Treap::argmin_life(curr);
        struct Treap *L, *R;
        Treap::split(curr, k, L, curr);
        Treap::split(curr, 1, curr, R);
        ans[curr->id] = curr->pos;
        curr = Treap::merge(L, R);
      }
    }
    std::swap(curr, next);
  }
  for (int i = 0; i < Q; i++) {
    printf("%I64d\n", ans[i]);
  }
}
