#include <bits/stdc++.h>
using namespace std;
long long n, a[100010], dist[100010];
vector<long long> psum;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n - 1; i++) {
    dist[i] = a[i + 1] - a[i];
  }
  psum.push_back(dist[1]);
  for (int i = 2; i <= n - 1; i++) {
    int t = psum[i - 2];
    psum.push_back(t + dist[i]);
  }
  long long l, q;
  cin >> l >> q;
  while (q--) {
    long long sum = l;
    long long ans = 1;
    long long u, v;
    cin >> u >> v;
    if (u > v) {
      swap(u, v);
    }
    long long pre = 0;
    while (sum < a[v] - a[u]) {
      long long k =
          upper_bound(psum.begin() + u - 1, psum.end(), sum) - psum.begin();
      sum += (psum[k - 1] - pre);
      pre = psum[k - 1];
      ans++;
    }
    cout << ans << "\n";
  }
  cout << "\n";
}
