Division and Union CodeForces - 1101C (排序後處理)
There are nn segments [li,ri][li,ri] for 1≤i≤n1≤i≤n. You should divide all segments into two non-empty groups in such way that there is no pair of segments from different groups which have at least one common point, or say that it's impossible to do it. Each segment should belong to exactly one group.
To optimize testing process you will be given multitest.
Input
The first line contains one integer TT (1≤T≤500001≤T≤50000) — the number of queries. Each query contains description of the set of segments. Queries are independent.
First line of each query contains single integer
The next nn lines contains two integers lili, riri per line (