#include <bits/stdc++.h>
using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define loop(i,a,b) for(ull i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define riter(i,c) for(auto i=(c).rbegin(); i!=(c).rend(); ++i)

const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

#define clr(a,i) memset((a), (i) ,sizeof(a))

int main(){
  int n,l,q;
  std::cin >> n;
  vi x(n);
  rep(i,n) std::cin >> x[i];
  std::cin >> l >> q;
  long long a,q,ans,w-0,s,t;
  rep(i,q){
    ans=w=0;
    std::cin >> a >> q;
    loop(j,a-1,q){
      w+=x[j+1]-x[j];
      if(w>l){
        w=x[j+1]-x[j];
        ans++;
      }
    }
    std::cout << ans << std::endl;
  }
}
