#include <bits/stdc++.h>
using namespace std;
int N, X[100005], L, Q;
void solve() {
  for (int q = 0; q < Q; q++) {
    int a, b;
    scanf("%d%d", &a, &b);
    if (a > b) swap(a, b);
    int ans = 1, p = a + 1, l = X[a + 1] - X[a];
    while (1) {
      if (p == b) break;
      int d = X[p + 1] - X[p];
      if (l + d >= L) {
        l = 0, ans++;
        if (p + 1 == b) break;
      } else {
        l += d, p++;
      }
    }
    printf("%d\n", ans);
  }
}
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) scanf("%d", X + i);
  scanf("%d", &L);
  scanf("%d", &Q);
  solve();
  return 0;
}
