#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int64_t N;
  cin >> N;
  vector<int64_t> x(N);
  for (int64_t i = (int64_t)(0); i < (int64_t)(N); i++) cin >> x[i];
  int64_t L, Q;
  cin >> L >> Q;
  vector<array<int64_t, 2>> ab(Q);
  for (int64_t i = (int64_t)(0); i < (int64_t)(Q); i++)
    cin >> ab[i][0] >> ab[i][1];
  for (int64_t i = (int64_t)(0); i < (int64_t)(Q); i++)
    for (int64_t j = (int64_t)(0); j < (int64_t)(2); j++) ab[i][j]--;
  for (int64_t i = (int64_t)(0); i < (int64_t)(Q); i++) {
    int64_t answer = 1, pos = min(ab[i][0], ab[i][1]),
            goal = max(ab[i][0], ab[i][1]);
    int64_t capacity = L;
    for (; pos < goal; pos++) {
      int64_t len = x[pos + 1] - x[pos];
      if (len <= capacity)
        capacity -= len;
      else {
        capacity = L - len;
        answer++;
      }
    }
    cout << answer << endl;
  }
}
