#include <bits/stdc++.h>
using namespace std;
long long n, x[200000], g[200000], l, q, a, b;
int main() {
  scanf("%lld", &n);
  int i;
  for (i = 1; i <= n; i++) {
    scanf("%lld", &x[i]);
  }
  scanf("%lld%lld", &l, &q);
  for (i = 1; i <= q; i++) {
    scanf("%lld%lld", &a, &b);
    if (abs(a - b) == 1) {
      printf("1\n");
    } else {
      int q = min(a, b), w = max(a, b);
      int k = l, d, sum = 1;
      for (int i = q; i < w; i++) {
        d = x[i + 1] - x[i];
        if (k >= d) {
          k -= d;
        } else {
          sum++;
          k = l;
          --i;
        }
      }
      printf("%d\n", sum);
    }
  }
}
