#include <bits/stdc++.h>
using namespace std;
static const long long INF = 1LL << 61;
static const long long MOD = 1000000007;
static const long long MAX_N = 100005;
long long n, l, q, x[MAX_N];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (long long i = 1; i <= n; ++i) cin >> x[i];
  cin >> l >> q;
  for (long long i = 0; i < q; ++i) {
    long long ta, tb, a, b;
    cin >> ta >> tb;
    a = min(ta, tb);
    b = max(ta, tb);
    long long ans = 0;
    long long one = 0;
    for (long long j = a; j < b; ++j) {
      if (l < one + x[j + 1] - x[j]) {
        one = 0;
        ans++;
        j--;
        continue;
      }
      one += x[j + 1] - x[j];
    }
    if (one) ans++;
    cout << ans << endl;
  }
}
