You are given n integers a_1, a_2, …, a_n. Find the maximum value of max(a_l, a_{l + 1}, …, a_r) ⋅ min(a_l, a_{l + 1}, …, a_r) over all pairs (l, r) of integers for which 1 ≤ l < r ≤ n.

Input

The first line contains a single integer t (1 ≤ t ≤ 10 000) — the number of test cases.

The first line of each test case contains a single integer n (2 ≤ n ≤ 10^5).

The second line of each test case contains n integers a_1, a_2, …, a_n (1 ≤ a_i ≤ 10^6).

It is guaranteed that the sum of n over all test cases doesn't exceed 3 ⋅ 10^5.

Output

For each test case, print a single integer — the maximum possible value of the product from the statement.

Example

Input


4
3
2 4 3
4
3 2 3 1
2
69 69
6
719313 273225 402638 473783 804745 323328


Output


12
6
4761
381274500335

Note

Let f(l, r) = max(a_l, a_{l + 1}, …, a_r) ⋅ min(a_l, a_{l + 1}, …, a_r).

In the first test case, 

  * f(1, 2) = max(a_1, a_2) ⋅ min(a_1, a_2) = max(2, 4) ⋅ min(2, 4) = 4 ⋅ 2 = 8. 
  * f(1, 3) = max(a_1, a_2, a_3) ⋅ min(a_1, a_2, a_3) = max(2, 4, 3) ⋅ min(2, 4, 3) = 4 ⋅ 2 = 8. 
  * f(2, 3) = max(a_2, a_3) ⋅ min(a_2, a_3) = max(4, 3) ⋅ min(4, 3) = 4 ⋅ 3 = 12. 



So the maximum is f(2, 3) = 12.

In the second test case, the maximum is f(1, 2) = f(1, 3) = f(2, 3) = 6.
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.abs;
import static java.lang.System.out;
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() ;
			}
			
			long min1 = Math.min(arr[0],arr[1]) ;
			long max1 = Math.max(arr[0],arr[1]) ;
			long ans1 = -1 ;
			for(int i = 2 ; i< n-1 ; i++) {
				int x = min(arr[i],arr[i+1]) ;
				int y = max(arr[i],arr[i+1]) ;
				if(min1 < x) {
					min1 = x ;
				}
				
				if(max1 < y) {
					max1 = y ;
				}
			}
			
			ans1 = min1*max1 ;
			
			long min2 = Math.min(arr[n-1],arr[n-2]) ;
			long max2 = Math.min(arr[n-1],arr[n-2]) ;
			long ans2 = -1 ;
			for(int i = n-1 ; i> 0 ; i-- ) {
				int x = min(arr[i],arr[i-1]) ;
				int y = max(arr[i],arr[i-1]) ;
				if(min2 < x) {
					min2 = x ;
				}
				
				if(max2 < y) {
					max2 = y ;
				}
			}
			
			ans2 = min2*max2 ;
//			System.out.println(ans1 + " " + ans2);
			System.out.println(Math.max(ans1,ans2));
		}
		
		
	}


	/*
	 @ Observation is imp. for problem A and B
	 1->> Read the problem properly take time to read the problem 
	 if it is too lengthy.
	 2->> Draw the test cases of A and B 
	 3->> Don't over think the problem 
	 4->> Try to take sum variable as long
	 5->> Avoid Nested if else statement
	 6->> If it looks like a Greedy problem try to figure out the ans. 
	 for the smallest test case.
	 7->> If it is a binary String check no. of 0's and 1's. 
	 If it is a even try to pair it (may be not applicable for every questions).
	 8->> Always check the constrains and try BruteForce
	 @ Implement it quickly 
	 */
	

	
	
	


	
	
//_________________________//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;
	        }
		}
	
	
		
		
		
		// Sorting
		public static void sort(int[] arr) {
	        //because Arrays.sort() uses quicksort which is dumb
	        //Collections.sort() uses merge sort
	        ArrayList<Integer> ls = new ArrayList<Integer>();
	        for(int x: arr)
	            ls.add(x);
	        Collections.sort(ls);
	        for(int i=0; i < arr.length; i++)
	            arr[i] = ls.get(i);
	    }
		
		
		
		
		
		// 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 ;
				 }
				}
			}
			
		}

		
		
		
		// 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;
	    }
		

}


 
 
 
 
 
 
