#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N, L, q;
  cin >> N;
  vector<long long> X(N);
  for (long long i = 0; i < N; i++) cin >> X[i];
  cin >> L >> q;
  long long dp[30][100010];
  for (long long i = 0; i < 30; i++)
    for (long long j = 0; j < 100010; j++) dp[i][j] = 1000000000 * 10;
  for (long long i = 0; i < N - 1; i++) {
    dp[0][i] = X[i + 1] - X[i];
  }
  for (long long i = (1); i < (30); ++i) {
    for (long long j = 0; j < N - 1; j++) {
      if (j + (1LL << (i - 1)) > N - 2) break;
      if (dp[i - 1][j + (1LL << (i - 1))] != 1000000000 * 10 &&
          j + (1LL << (i - 1)) <= N - 2)
        dp[i][j] = dp[i - 1][j] + dp[i - 1][j + (1LL << (i - 1))];
    }
  }
  while (q--) {
    long long a, b;
    cin >> a >> b;
    a--;
    b--;
    if (b < a) swap(a, b);
    long long ans = 0;
    long long dist = 0;
    long long now = a;
    do {
      if (dist == 0) ans++;
      bool F = true;
      for (long long i = 25; i >= 0; i--) {
        if (dp[i][now] + dist <= L) {
          F = false;
          dist += dp[i][now];
          now += (1LL << i);
        }
      }
      if (now >= b) {
        cout << ans << endl;
        break;
      }
      if (F) dist = 0;
    } while (1);
  }
  return 0;
}
