#include <bits/stdc++.h>
int main() {
  int i, N, x[100002], L, q, Q, l, r, ans, sum;
  scanf("%d", &N);
  for (i = 0; i < N; i++) scanf("%d", &(x[i]));
  for (i = N - 1; i >= 1; i--) x[i] -= x[i - 1];
  scanf("%d", &L);
  scanf("%d", &Q);
  for (q = 1; q <= Q; q++) {
    scanf("%d %d", &l, &r);
    if (l > r) {
      l ^= r;
      r ^= l;
      l ^= r;
    }
    for (ans = 1, sum = x[l]; l < r; sum += x[++l]) {
      if (sum > L) {
        ans++;
        sum = x[l];
      }
    }
    printf("%d\n", ans);
  }
  fflush(stdout);
  return 0;
}
