#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:500000000")
using namespace std;
int nextInt() {
  int n;
  scanf("%d", &n);
  return n;
}
long long nextLong() {
  long long n;
  scanf("%lld", &n);
  return n;
}
const double PI = acos(-1.0);
const double EPS = 1e-9;
const int INF = (int)2e9;
const int MOD = (int)1e9 + 7;
int x[(int)1e5 + 9];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &x[i]);
  }
  int l, q;
  scanf("%d %d", &l, &q);
  while (q--) {
    int a, b;
    scanf("%d %d", &a, &b);
    --a;
    --b;
    int res = 1;
    int sum = 0;
    if (a < b) {
      for (int i = a + 1; i <= b; ++i) {
        if (sum + x[i] - x[i - 1] > l) {
          ++res;
          sum = 0;
        }
        sum += x[i] - x[i - 1];
      }
    } else {
      swap(a, b);
      for (int i = b - 1; i >= a; --i) {
        if (sum + x[i + 1] - x[i] > l) {
          ++res;
          sum = 0;
        }
        sum += x[i + 1] - x[i];
      }
    }
    printf("%d\n", res);
  }
  return 0;
}
