#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const double pi = acos(-1.0);
const double inf = (int)1e8;
int main() {
  int n, l, q;
  std::cin >> n;
  vector<int> x(n);
  for (unsigned long long i = (0); i < unsigned long long(n); ++i)
    std::cin >> x[i];
  std::cin >> l >> q;
  long long a, ans, w, b;
  for (unsigned long long i = (0); i < unsigned long long(q); ++i) {
    ans = 1;
    w = 0;
    std::cin >> a >> b;
    if (b > a)
      for (unsigned long long j = (a - 1); j < unsigned long long(b - 1); ++j) {
        w += x[j + 1] - x[j];
        if (w > l) {
          w = x[j + 1] - x[j];
          ans++;
        }
      }
    else
      for (int j = a - 1; j > b - 1; j--) {
        w += x[j] - x[j - 1];
        if (w > l) {
          w = x[j] - x[j - 1];
          ans++;
        }
      }
    std::cout << ans << std::endl;
  }
}
