ADIVB - Divide
Dữ liệu vào: Standard input
Dữ liệu ra: Standard output
Giới hạn thời gian: 1.0 giây
Giới hạn bộ nhớ: 128 megabyte
Đăng bởi: admin

 Given an array \(A=(a_1,a_2,...,a_n)\). Mr Toàn wants to know if there exists a subset \(B\) of this array which follows these statements:

-  \(B\) is a non-empty subset.

- There exists no integer \(x(x>1)\) which divides all elements of \(B\).

- There are no elements of  \(B\) which are equal to another.

Input: 

The first line of input contains an integer \(T\), representing the number of test cases. Then \(T\) test cases follow.
Each test case consists of two lines. The first line contains an integer, \(N\), representing the size of array \(A\). In the second line there are \(N\) space-separated integers \(A=(a_1,a_2,...,a_n)\), representing the elements of array \(A\).

Output:

Print YES if such a subset exists; otherwise, print NO.

Constraints
1 ≤  T ≤ 10

1 ≤  N ≤ 100
1 ≤  ai  ≤ 105

Ví dụ

  • input
    3
    3
    1 2 3
    2
    2 4
    3
    5 5 5
    output
    YES
    NO
    NO
Back to Top