#include <bits/stdc++.h>
using namespace std;
int x[1001];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n + 1; ++i) scanf("%d", x + i);
  int l, q;
  scanf("%d%d", &l, &q);
  while (q--) {
    int a, b;
    scanf("%d%d", &a, &b);
    if (a > b) swap(a, b);
    int an = 1;
    int st = 0;
    while (a < b) {
      st += x[a + 1] - x[a];
      if (st > l) st = x[a + 1] - x[a], ++an;
      ++a;
    }
    printf("%d\n", an);
  }
}
