#K60317. GCD Sequence
GCD Sequence
GCD Sequence
You are given a sequence of integers for each test case. Your task is to compute the greatest common divisor (GCD) of all the integers in the sequence. Mathematically, for a given sequence \(a_1, a_2, \dots, a_n\), you need to compute:
$$\gcd(a_1,a_2,\dots,a_n)$$
This computed GCD represents the minimum possible integer that can remain in the sequence after performing the allowed operations.
For each test case, simply output the GCD of the provided numbers.
inputFormat
The input is read from standard input (stdin) and has the following format:
- The first line contains an integer \(T\) denoting the number of test cases.
- For each test case, the first line contains an integer \(n\) representing the number of elements in the sequence.
- The second line contains \(n\) space-separated integers representing the sequence.
outputFormat
For each test case, output a single line to standard output (stdout) containing the greatest common divisor of the sequence.
## sample2
3
6 9 15
4
8 4 12 16
3
4
</p>