#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int x[N];
int id[N];
int main() {
  int n;
  long long L;
  scanf("%d", &n);
  int bz = sqrt(n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x[i]);
  }
  scanf("%lld", &L);
  int Q;
  scanf("%d", &Q);
  while (Q--) {
    int l, r;
    scanf("%d%d", &l, &r);
    long long cur = 0;
    int cnt = 0;
    if (l < r) {
      for (int i = l; i <= r - 1; i++) {
        if (cur + x[i + 1] - x[i] > L) {
          cnt++;
          cur = 0;
        }
        cur += x[i + 1] - x[i];
      }
      if (cur) cnt++;
      printf("%d\n", cnt);
    } else {
      for (int i = l; i >= r + 1; i--) {
        if (cur + x[i] - x[i - 1] > L) {
          cnt++;
          cur = 0;
        }
        cur += x[i] - x[i - 1];
      }
      if (cur) cnt++;
      printf("%d\n", cnt);
    }
  }
  return 0;
}
