Ehab has an array a of length n. He has just enough free time to make a new array consisting of n copies of the old array, written back-to-back. What will be the length of the new array's longest increasing subsequence?

A sequence a is a subsequence of an array b if a can be obtained from b by deletion of several (possibly, zero or all) elements. The longest increasing subsequence of an array is the longest subsequence such that its elements are ordered in strictly increasing order.

Input

The first line contains an integer t — the number of test cases you need to solve. The description of the test cases follows.

The first line of each test case contains an integer n (1 ≤ n ≤ 10^5) — the number of elements in the array a.

The second line contains n space-separated integers a_1, a_2, …, a_{n} (1 ≤ a_i ≤ 10^9) — the elements of the array a.

The sum of n across the test cases doesn't exceed 10^5.

Output

For each testcase, output the length of the longest increasing subsequence of a if you concatenate it to itself n times.

Example

Input


2
3
3 2 1
6
3 1 4 1 5 9


Output


3
5

Note

In the first sample, the new array is [3,2,1,3,2,1,3,2,1]. The longest increasing subsequence is marked in bold.

In the second sample, the longest increasing subsequence will be [1,3,4,5,9].
import java.util.* ;
import java.math.*;
import java.io.*;


 public class javaTemplate {
	
	public static final int M = 1000000007 ;
	static FastReader sc = new FastReader();
	static int N = 86028121 ;
	static boolean globB[] = new boolean[N+1] ;
	static int globA[] = new int[10000000] ;
	
	
	public static void main(String[] args) {
		
		
	int t = sc.nextInt() ;
		
		while(t -- != 0) {
			int n = sc.nextInt() ;
			int arr[] = new int[n] ;
			for(int i = 0 ; i< n ; i++) {
				arr[i] = sc.nextInt() ;
			}
			
			Arrays.sort(arr) ;
			int ans = 0 ;
			for(int i = 0 ; i< n-1 ; i++) {
				if(arr[i] < arr[i+1]) ans ++ ;
			}
			
			System.out.println(++ans);
		}
		
		
		
	}
	


	
	

	
	
			
	
	
	
	


	
	
//_________________________//Template//_____________________________________________________________________
	
	
		//		FAST I/O
		static class FastReader {
	        BufferedReader br;
	        StringTokenizer st;
	        
	        public FastReader()
	        {
	            br = new BufferedReader(
	                new InputStreamReader(System.in));
	        }
	 
	        String next()
	        {
	            while (st == null || !st.hasMoreElements()) {
	                try {
	                    st = new StringTokenizer(br.readLine());
	                }
	                catch (IOException e) {
	                    e.printStackTrace();
	                }
	            }
	            return st.nextToken();
	        }
	 
	        int nextInt() { return Integer.parseInt(next()); }
	 
	        long nextLong() { return Long.parseLong(next()); }
	 
	        double nextDouble()
	        {
	            return Double.parseDouble(next());
	        }
	 
	        String nextLine()
	        {
	            String str = "";
	            try {
	                str = br.readLine();
	            }
	            catch (IOException e) {
	                e.printStackTrace();
	            }
	            return str;
	        }
		}
	
	
		
		
//		Check Perfect Squre
		public static boolean checkPerfectSquare(double number) {   
			double sqrt=Math.sqrt(number);   
			return ((sqrt - Math.floor(sqrt)) == 0);   
		}   
		
		
		
		
		
		// Modulo
		static int mod(int a) {
		   return (a%M + M) % M;
		}
		
		
		
		
		
		
		
		//		Palindrom or Not
		static boolean isPalindrome(String str, int low, int high) {
					
					while (low < high) {
						if (str.charAt(low) != str.charAt(high)) return false;
					 	low++;
					 	high--;
					}
					return true;
				}
	
	

	
	
	
	
	
	
	
	
		// check if sorted or not	
		public static boolean isSorted(int[] a)
	    {
	        for (int i = 0; i < a.length - 1; i++)
	        {
	            if (a[i] > a[i + 1]) {
	                return false;
	            }
	        }
	        return true;
	    }
	
	
	
		
		
	
		// GCD
		public static int GCD(int a , int b) {
				if(b == 0) return a ;
				
				return GCD(b, a%b) ;
			}
	
		
		
		
		
		// sieve
// 		public static void sieve() {
// 			Arrays.fill(globB, true);
// 			globB[0] = false ;
// 			globB[1] = false ;
// 			for(int i = 2 ; i * i <= N ; i++) {
// 				if(globB[i]) {
// 				for(int j = i * i ; j<= N ; j+= i) {
// 					globB[j] = false ;
// 				 }
// 				}
// 			}
// 			for(int i = 2 ; i<= N ; i++) {
// 				if(globB[i]) {
// 					ds.add(i) ;
// 				}
// 			}
// 		}

		
		
		
		// fastPower
		public static long fastPowerModulo(long a, long b, long n) {
			long res = 1 ;
			while(b > 0) {
			if((b&1) != 0) {
				res = (res * a % n) % n ;
			}
			a = (a % n * a % n) % n ;
			b = b >> 1 ;
			}
			return res ;
		}
	
		
		
        // LCM
		static int LCM(int a, int b)
	    {
	        return (a / GCD(a, b)) * b;
	    }
		

}




