cho.sh
Notes
Loading...

Wire Connection

Time limit

2s

Memory limit

128 MB

Problem

There are N semicircular wires. For each wire, its radius is given.

You may choose some of the wires and attach endpoints of two wires at any angle, rotating each semicircle freely. Determine whether the chosen wires can be connected by endpoints to form one connected closed curve. The middle parts of different wires must not overlap.

Input

The first line contains the number of data sets K (1 <= K <= 30).

For each data set, the first line contains N (1 <= N <= 20). The next line contains N real numbers, the radii of the semicircles. Each radius is a positive real number at most 10,000,000 and may be given with up to three digits after the decimal point.

Output

For each data set, print YES if it is possible, and NO otherwise.