#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1, ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int MAXN = 100000 + 10;
int x[MAXN];
int main() {
  int n = read();
  for (register int i = 1; i <= n; i++) x[i] = read();
  int l = read(), q = read();
  while (q--) {
    int a = read(), b = read(), s = l, ans = 0;
    if (a > b) swap(a, b);
    for (register int i = a; i <= b; i++) {
      if (x[i + 1] - x[i] > s) {
        s = l;
        ans++;
      }
      s -= x[i + 1] - x[i];
    }
    printf("%d\n", ans);
  }
  return 0;
}
