Good Partition
题号:NC273394
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

A set is called a good set if the sum of any two numbers in the set is not a perfect square.
Given a set A containing n elements, our goal is to partition the set into two non-empty parts B_1 and B_2 (i.e., A=B_1\cup B_2 and B_1\cap B_2=\emptyset) such that both parts B_1 and B_2 in the partition are good sets.
Please determine whether the goal above is achievable for the given set A.
It is guaranteed that elements in set A are all distisnct.

输入描述:

The first line contains a single integer T (1\leq T\leq 5), representing the number of test cases.
The first line of each test case contains a single integer n (1\leq n\leq 10^5), representing the number of elements in the set A.
The second line of each test case contains n integers A_1, \cdots, A_n (1\leq A_i\leq 2\times 10^5), representing the n elements in set A.

输出描述:

For each test case, output "YES" if the goal is achievable, and "NO" otherwise.
示例1

输入

复制
2
5
1 2 3 4 5
3
6 19 30

输出

复制
YES
NO