Raj wants to buy an array of integers. As you know nothing is free these days, so to buy the array Raj needs to pay amount equal to lowest integer with a and b as their divisors. Here a and b are the minimum and maximum of the given array respectively. As Raj is weak at mathematics help him to find the cost he needs to pay.
First line of each test case contains an integer T, denoting number of test cases. First line of each test case contains an integer N, denoting the size of the array. Second line of each test case contains N space separated integers denoting the elements of the array.
For each test case print the amount Raj needs to pay in separate lines.
A[i] represents the ith element of the array.
2 4 3 5 8 6 4 1 2 8 6
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.