B. Dividing
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Given $$$n$$$ integers, is there any one of them that divides all the others?

Input

The input starts with an integer $$$t$$$ indicating the number of test cases.

Each test case begins with an integer $$$n$$$ followed by $$$n$$$ integers $$$a_i$$$.

Output

For each test case, output "SI" or "NO" depending on whether the indicated integer exists or not.

Scoring

$$$1 \leq t \leq 100$$$

$$$1 \leq a_i \leq 10^9$$$

$$$2 \leq n$$$

14 Points: $$$n = 2$$$

43 Points: $$$n \leq 100$$$

43 Points: $$$n \leq 10000$$$

Example
Input
4
2
10 18
6
2 7 3 7 8 7
6
4 6 1 3 4 1
6
4 2 4 6 8 4
Output
NO
NO
SI
SI