CF1771C.Hossam and Trainees

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Hossam has nn trainees. He assigned a number aia_i for the ii -th trainee.

A pair of the ii -th and jj -th ( iji \neq j ) trainees is called successful if there is an integer xx ( x2x \geq 2 ), such that xx divides aia_i , and xx divides aja_j .

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 tt ( 1t1051 \le t \le 10^5 ), the number of test cases. Description of the test cases follows.

The first line of each test case contains an integer number nn ( 2n1052 \le n \le 10^5 ).

The second line of each test case contains nn integers, the number of each trainee a1,a2,,ana_1, a_2, \dots, a_n ( 1ai1091 \le a_i \le 10^9 ).

It is guaranteed that the sum of nn over all test cases does not exceed 10510^5 .

输出格式

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=48a_1 = 32, a_2 = 48 , you can choose x=4x = 4 .

首页