quickmath

Time limit: 1s Memory limit: 64MB Input: Output:

Two plus two is four. Minus one, that's three, quick maths.

Task

Given an array aa of nn integers, such that nai2nn \leq |a_i| \leq 2 \cdot n, determine if there are three numbers in the array that add up to zero. Since this problem seems quite straightforward, you will need to answer this question for tt such arrays.

Input data

The first line contains tt, the number of test cases. Each test case will contain nn, the number of values in the array, on the first line. The following line will contain the values of the array.

Output data

For each test case, print DA (yes in Romanian) if you can find three values that sum up to 00, or NU (no in Romanian) otherwise.

Constraints and clarifications

  • 1t101 \leq t \leq 10;
  • 1n200 0001 \leq n \leq 200 \ 000;
  • nai2nn \leq |a_i| \leq 2 \cdot n.
# Points Constraints
1 32 N200N \leq 200
2 29 N2 000N \leq 2 \ 000
3 39 No additional constraints

Example

stdin

4
6
7 9 12 -6 -9 -6
8
12 15 13 -16 -9 -8 12 14
7
-9 -8 -14 12 7 11 7
12
-13 -24 18 15 14 14 17 -19 -21 -23 -18 14

stdout

DA
NU
DA
NU

Explanation

For the first example, we can get the sum 00 by summing 1212, 6-6, and 6-6.

For the third example, we can get the sum 00 by summing 14-14, 77, and 77.

Log in or sign up to be able to send submissions!