class Hotel:

    def query(self, N, x, L, Q, ab):

        x.append(pow(10, 9))

        for AB in ab:

            AB[0], AB[1] = min(AB[0], AB[1]), max(AB[0], AB[1])

            ans = 0
            current_hotel = AB[0]-1
            while current_hotel < AB[1]-1:

               
                l = L

                while x[current_hotel+1] - x[current_hotel] <= l:

                    l -= (x[current_hotel+1] - x[current_hotel])
                    current_hotel += 1

                ans += 1

            print ans


if __name__ == "__main__":

    N = input()
    x = [int(i) for i in raw_input().split()]
    L = input()
    Q = input()
    ab = [[int(j) for j in raw_input().split()] for i in range(Q)]

    abc = Hotel()
    abc.query(N, x, L, Q, ab)
