#P7312. [COCI 2018/2019 #2] Sunčanje
[COCI 2018/2019 #2] Sunčanje
Description
Slavko had an unusual dream. On a sunny morning, white rectangles climbed onto the roof of Slavko’s house one after another and sunbathed there. Each rectangle chose a position on the roof so that its sides were parallel to the edges of the roof. Some rectangles may cover areas where other rectangles are located. For each rectangle, its length and width are , and its distances to the left and bottom edges of the roof are , respectively.
After sunset, the rectangles climbed down from the roof and slept. The next day, they found that some rectangles had turned yellow, while others remained white. The rectangles that turned yellow were those that were completely exposed to sunlight.
Determine for each rectangle whether it turned yellow.
Input Format
The first line contains a positive integer , indicating the number of rectangles.
The next lines each contain integers . The input order is the same as the order in which they climbed onto the roof.
Output Format
Output lines. If the -th rectangle turned yellow, output DA on the -th line; otherwise, output NE on that line.
5
1 1 4 2
6 1 1 1
2 2 2 3
3 4 3 2
4 0 1 2
NE
DA
NE
DA
DA
3
3 3 1 1
2 2 3 3
1 1 5 5
NE
NE
DA
Hint
Explanation for Sample 1
Rectangles were not completely exposed to sunlight, so they did not turn yellow:

Constraints
For of the testdata, .
For of the testdata, , , .
Notes
The score setting follows the original COCI problem. Full score is .
Translated from COCI2018-2019 CONTEST #2 T5 Sunčanje.
Translated by ChatGPT 5
京公网安备 11011102002149号