#include <bits/stdc++.h>
using namespace std;
int N, L, Q;
int v[112345];
int main() {
  cin >> N;
  for (int i = 0; i < N; ++i) cin >> v[i];
  cin >> L >> Q;
  while (Q--) {
    int l, r;
    cin >> l >> r;
    if (l > r) swap(l, r);
    l--;
    int acc = 0;
    int cont = 1;
    for (int i = l + 1; i < r; ++i) {
      acc += v[i] - v[i - 1];
      if (acc > L) acc = v[i] - v[i - 1], cont++;
    }
    cout << cont << endl;
  }
  return 0;
}
