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 n 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.
The first line contains the number of test cases t. (t≤250)
For each test case, the first line contains the number of professors n. (2≤n≤105)
Each of the next n lines describes professor i's class: its start time starti and end time endi. (0≤starti<endi≤109)
The total size of the input does not exceed 50MB.
For each test case, print on its own line the minimum number of rooms needed to assign every class to a room.