#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  vector<long long> x(n);
  for (long long i = 0; i < n; i++) {
    cin >> x[i];
  }
  vector<long long> right(n);
  for (long long i = 0; i < n - 1; i++) {
    right[i] = x[i + 1] - x[i];
  }
  right[n - 1] = -1;
  long long klim = log2(n) + 1;
  vector<vector<long long>> kright(klim, vector<long long>(n, -1));
  for (long long i = 0; i < n; i++) {
    kright[0][i] = right[i];
  }
  for (long long k = 1; k < klim; k++) {
    for (long long i = 0; i < n; i++) {
      if (i + (1 << k) < n) {
        kright[k][i] = kright[k - 1][i] + kright[k - 1][i + (1 << (k - 1))];
      } else {
        kright[k][i] = -1;
      }
    }
  }
  vector<long long> next_hotel(n);
  auto n_hotel = [&](long long s, long long l) -> long long {
    for (long long k = klim - 1; k >= 0; k--) {
      if (kright[k][s] != -1) {
        if (l >= kright[k][s]) {
          l -= kright[k][s];
          s += (1 << k);
        }
      }
    }
    return s;
  };
  auto min_days = [&](long long a, long long b, long long l) -> long long {
    long long now = a;
    long long days = 0;
    while (now < b) {
      now = next_hotel[now];
      days++;
    }
    return days;
  };
  long long l, q;
  cin >> l >> q;
  for (long long i = 0; i < n; i++) {
    next_hotel[i] = n_hotel(i, l);
  }
  vector<long long> ans(q);
  for (long long qq = 0; qq < q; qq++) {
    long long a, b;
    cin >> a >> b;
    a--;
    b--;
    if (a > b) swap(a, b);
    ans[qq] = min_days(a, b, l);
  }
  for (long long i = 0; i < q; i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
