#000603

ProstPoligon

Coordinates of the n points in a plane are given. Those points are vertices of a polygon (in a given order). Determine if that polygon is simple (does not cross itself).



Input The first line of the standard input contains number t <= 5, number of polygons to be tested. Description of polygons follows (same format for all t of them): the first line contains integer 3 <= n <= 10^3 - number of vertices. Each of the next n lines contains two integers xi and yi - coordinates of the i-th vertex (-10^6 <= xi, yi <= 10^6). No two points coincide.


Output To the standard output for each polygon write 'DA', if that polygon is simple, otherwise write 'NE' (without quotes). All answers should be written in separate lines and in the same order as the polygons in the input.



Input:
2
3
0 0
0 1
1 1
5
0 0
2 0
2 2
1 0
0 2

Output:
DA
NE

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.