#include<bits/stdc++.h>
using namespace std;
#define sync ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int main(){
sync
int t;
cin>>t;
while(t–){
int n;
cin>>n;
pair<int,int> p[n];
for(auto i=0;i<n;i++)
cin>>p[i].first>>p[i].second;
vector v(100,0);
for(int i=0;i<n;i++)
v[p[i].second-p[i].first]++;
cout<<*max_element(v.begin(),v.end())<<"\n";
}
}