I I U P C   2 0 1 4

Problem D: Easy Peasy

 

Given an array of integers, find the number of the segments of the array without repeating integers in the segment. For example, number of the segments of the array without repeating letters for {1,2,1} is 5. In 0 based indexing, these segments are (0,1), (1,2),  (0), (1), (2).

 

Input

Input starts with T (≤ 20), the number of test cases to follow.

For each test case, in the first line one integer N(1N100000) is given. N is the number of integers in the array. In the next line N integers separated by space is given. ith integer will be arr[i] (0arr[i]1000000000 ).

 

Output

For each case, print the number of the segments of the array without repeating integers in the segment.

 

 

Sample Input

Output for Sample Input

2

3

1 2 1

5

1 2 3 1 2

5

12

 

Problem Setter: F. A. Rezaur Rahman Chowdhury

Alternate Solution: Mohammad Hafiz Uddin