#M. JIXMPII5JUh0SM0#~//
JIXMPII5JUh0SM0#~//
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Statement
Mocha likes arrays, so before her departure, 378QAQ gave her an array consisting of positive integers as a gift.
Mocha thinks that is beautiful if there exist two numbers and ( , ) such that for all ( ), is divisible by either or .
Determine whether is beautiful.
is divisible by if there exists an integer such that .
Format
Input
Each test contains multiple test cases. The first line contains the number of test cases ( ). The description of the test cases follows.
The first line of each test case contains a single integer ( ) — the length of the array .
The second line of each test case contains integers ( ) — the elements of the array .
It is guaranteed that the sum of over all test cases does not exceed .
Output
For each test case, output "Yes" if array 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