Yash loves XOR

5

1 votes
Easy
Problem

Recently Yash watched the webinar of Bitmasking and Segment-tree by Coding Blocks. After watching the webinar his love for XOR is increased and he asks Prince to give the problem of XOR in CodeCadet. So the problem by him is :

You are given an array A of N elements. You are also given Q queries. In each query, you are given two integer L and R. Your task is to find the XOR of elements between L and R (L and R inclusive) for each query.

Input :

The first line contains a single integer N denoting the size of the array.

The second line contains N elements denoting the array A.

The third line contains a single integer Q denoting the number of queries.

Next, Q lines contain two integer L and R.

Output :

For each query print the single integer denoting the XOR between L and R.

Constraint :

1N,Q106

1A[i]109

0LRN

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?