JIXMPII5JUh0SM0#~//

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

Statement

Mocha likes arrays, so before her departure, 378QAQ gave her an array a a consisting of n n positive integers as a gift.

Mocha thinks that a a is beautiful if there exist two numbers i i and j j ( 1i,jn 1\leq i,j\leq n , ij i\neq j ) such that for all k k ( 1kn 1 \leq k \leq n ), ak a_k is divisible ^\dagger by either ai a_i or aj a_j .

Determine whether a a is beautiful.

^\dagger x x is divisible by y y if there exists an integer z z such that x=yz x = y \cdot z .

Format

Input

Each test contains multiple test cases. The first line contains the number of test cases t t ( 1t500 1\leq t\leq 500 ). The description of the test cases follows.

The first line of each test case contains a single integer n n ( 3n105 3\leq n\leq 10^5 ) — the length of the array a a .

The second line of each test case contains n n integers a1,a2,,an a_1,a_2,\ldots,a_n ( 1ai109 1\leq a_i \leq 10^9 ) — the elements of the array a a .

It is guaranteed that the sum of n n over all test cases does not exceed 105 10^5 .

Output

For each test case, output "Yes" if array a a is beautiful, and output "No" otherwise.

Sample

4
3
7 3 8
5
7 1 9 3 5
5
4 12 2 6 3
5
7 49 9 3 1000000000
No
Yes
Yes
No

ShanghaiTech ACM 炸鱼杯

未参加
状态
已结束
规则
OI
题目
46
开始于
2024-12-10 23:00
结束于
2024-12-15 13:00
持续时间
110 小时
主持人
参赛人数
112