Introduction - If you have any usage issues, please Google them yourself
Think:
The computer, which seems to do the coolie was born, isn t it? Statistics is one of the workhorses, and if you are unlucky, just come up against many repeating data, more people feel boring. So, your task. Now, give you a list of several A1, A2,... An. Then will you answer, for a given interval, exactly how many don t repeat number.
Input:
An integer T (T < = 10), said a T test data. Each group of data is the first line number N (1 < = N < = 30000). The second line have N number A1 A2... An (0 < = Ai < = 2 ^ 31-1).The third line is a number (1 Q < = Q < = 100000). The next line is a Q Q ask X Y (1 < = X < = Y < = N).
Output:
For each inquiry, the output one answer, an answer of a line.
Sample Input:
2
3
1 1 4
2
1 2
2 3
5
1 1 2 1 3
3
1 of 5
2 4
3 5
Sample Output:
1
2
3
2
3
Returned:
ycc