#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int n, l, q;
  cin >> n;
  vector<long long int> x(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  cin >> l;
  cin >> q;
  vector<long long int> a(q), b(q), ans;
  for (int i = 0; i < q; i++) {
    cin >> a[i] >> b[i];
    long long int t = 0;
    long long int now, goal;
    if (a[i] > b[i]) {
      now = b[i] - 1;
      goal = a[i] - 1;
    } else {
      now = a[i] - 1;
      goal = b[i] - 1;
    }
    while (now < goal) {
      long long int go = 0;
      while (go <= l) {
        go += x[now + 1] - x[now];
        now++;
      }
      now--;
      go -= x[now + 1] - x[now];
      t++;
    }
    cout << t << endl;
  }
  return 0;
}
