#include <bits/stdc++.h>
using namespace std;
long long arr[200000];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long l;
  cin >> l;
  int q;
  cin >> q;
  while (q--) {
    int a, b, a1, b1;
    cin >> a1 >> b1;
    a = min(a1, b1);
    b = max(a1, b1);
    int cnt = 1, prev = a - 1;
    long long dist = 0;
    for (int i = a; i < b; i++) {
      if (dist + arr[i] - arr[i - 1] <= l) {
        dist += arr[i] - arr[i - 1];
      } else {
        cnt++;
        dist = arr[i] - arr[i - 1];
      }
    }
    cout << cnt << "\n";
  }
  return 0;
}
