using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ARC060_E
{
    class Program
    {
        static int ans;
        static void solve(int s,int g,int[] x,int L)
        {
           while(true)
           {
                if (Math.Abs(x[s] - x[g]) <= L)
                {
                    Console.WriteLine(ans + 1);
                    ans = 0;
                    return;
                }
                int news = x.TakeWhile(i => (i - x[s]) <= L).Count();
                s = news - 1;
                //Console.WriteLine(s);
                ans++;
              
            }
        }
        static void Main(string[] args)
        {
            int n = scan[0];
            var x = scan;
            int L = scan[0];
            int q = scan[0];
            for (int i = 0; i < q; i++)
            {
                var k = scan;
                if (k[0] < k[1]) solve(k[0] - 1, k[1] - 1, x, L);
                else solve(k[1] - 1, k[0] - 1, x, L)
;            }
        }

        static int[] scan
        {
            get { return Console.ReadLine().Split().Select(int.Parse).ToArray(); }
        }
    }
}
