Two Professors

No attempts yetTime limit3sMemory limit128 MB

Problem

A university has two professors who strongly dislike each other. At this university professors are referred to by number, and the two professors who dislike each other are numbered 1 and 2.

There are nn professors in total, and every class is held during the same time slot each day. Each professor teaches exactly one class. The start and end time of every class is already fixed; a class cannot be started earlier or ended later, and no classes other than the fixed ones may be held.

The room for each class has not been decided yet. Two classes whose times overlap cannot be assigned to the same room. However, if one class ends exactly when another begins, the two classes may share the same room. Determine the minimum number of rooms needed to assign every class to a room. Note that professor 1 and professor 2 dislike each other so much that they never hold their classes in the same room.

Input

The first line contains the number of test cases tt. (t250t \le 250)

For each test case, the first line contains the number of professors nn. (2n1052 \le n \le 10^5)

Each of the next nn lines describes professor ii's class: its start time startistart_i and end time endiend_i. (0starti<endi1090 \le start_i < end_i \le 10^9)

The total size of the input does not exceed 50MB.

Output

For each test case, print on its own line the minimum number of rooms needed to assign every class to a room.