CF1771C.Hossam and Trainees
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Hossam has n trainees. He assigned a number ai for the i -th trainee.
A pair of the i -th and j -th ( i=j ) trainees is called successful if there is an integer x ( x≥2 ), such that x divides ai , and x divides aj .
Hossam wants to know if there is a successful pair of trainees.
Hossam is very tired now, so he asks you for your help!
输入格式
The input consists of multiple test cases. The first line contains a single integer t ( 1≤t≤105 ), the number of test cases. Description of the test cases follows.
The first line of each test case contains an integer number n ( 2≤n≤105 ).
The second line of each test case contains n integers, the number of each trainee a1,a2,…,an ( 1≤ai≤109 ).
It is guaranteed that the sum of n over all test cases does not exceed 105 .
输出格式
Print the answer — "YES" (without quotes) if there is a successful pair of trainees and "NO" otherwise. You can print each letter in any case.
输入输出样例
输入#1
2 3 32 48 7 3 14 5 9
输出#1
YES NO
说明/提示
In the first example, the first trainee and the second trainee make up a successful pair:
a1=32,a2=48 , you can choose x=4 .