Now, This is the time for 'ENCORE' The cultural fest of IET. To entertain students, the Co-ordinators have arranged a magic show of well known magician 'Dynamo' for a day. Like every legendary magicians Dynamo has also a special trick.He wants to show this trick to every student of IET in his show. As this is fest time, every student is busy in some events, so it is not possible for everyone to be present at magic show at same time. There are N students in IET and the ith student reaches magic show at time ai and leaves at time bi. As special trick is so special, he doesn't want to play it frequently. So, Dynamo wants to know the minimum number of times he would have to show his special trick so that every student of IET can watch this. And yes, to play the trick he takes 0 second.
Input start with an integer T, denoting the number of test cases.
First line of every input consist an integer N (number of students).
Next N line contains two integers ai the arrival time and bi the leaving time of ith student.
For every test case, print the minimum number of times Dynamo plays his special trick.
1<=T<=10
1<=N<=10^5
1<=ai<bi<=10^9
Both ai and bi are inclusive.