Given an array of N positive integers. Your task is to find the GCD of all numbers of the array.
Input:
First line of input contains number of test cases T. First line of test case contains a positive integer N, size of the array. Next line contains the array elements.
Output:
For each testcase, print the GCD of array elements.
Constraints:
1 <= T <= 100
1 <= N <= 106
1 <= Arr[i] <= 106
Example:
Input:
1
2
5 10
Output:
5
Explanation:
Testcase 1: For array elements 5,10 GCD will be 5.
11620078 | 164 |
RohitBattu | 127 |
Maninder07 | 126 |
blackshadows | 120 |
Rags Bhasin | 110 |
blackshadows | 880 |
xmyqsh | 565 |
mb1973 | 439 |
aman19 | 402 |
shubhamjain237 | 376 |
akhayrutdinov | 5014 |
Ibrahim Nash | 4899 |
Quandray | 4338 |
sanjay05 | 3668 |
blackshadows | 3384 |