#include <bits/stdc++.h>
using namespace std;
long n, x[100100], l, q, a[100100], b[100100];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> x[i];
  cin >> l >> q;
  for (int i = 1; i <= q; i++) cin >> a[i] >> b[i];
  for (int i = 1; i <= q; i++) {
    int tot = 0, ii = i, day = 0, now = 1, dis = 0;
    if (b[i] > a[i]) swap(a[i], b[i]);
    while (now != b[i]) {
      day++;
      dis = x[now + 1] - x[now];
      tot = 0;
      while (tot + dis <= l) {
        tot += dis;
        now++;
        dis = x[now + 1] - x[now];
        if (now == b[i]) {
          cout << day << endl;
          break;
        }
      }
      cout << "test:" << now << endl;
    }
  }
  return 0;
}
