Given a sequence of length n as a1,a2,…,an.
There are a total of m queries, each query specifies l,r, and requires finding the number of subarrays [i,j] within the range [l,r] such that l≤i≤j≤r and the number of distinct elements in the subarray [i,j] is odd.
### Input
- The first line is an integer n.
- The next line contains n integers representing the sequence a1,a2,…,an.
- The following line contains an integer m.
- The next m lines each contain two integers l and r representing a query.
### Output
For each query, output a single integer on a new line, which is the result.
### Constraints
- n,m,ai≤106
- 1≤l≤r≤n
### Example #1
#### Input #1
52351552311132524
#### Output #1
21464
### Example #2
#### Input #2
10285110599351068123557173949143725
#### Output #2
4244161612696
`