#include using namespace std; typedef signed long long ll; #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define FORR2(x,y,arr) for(auto& [x,y]:arr) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) template bool chmax(T &a, const T &b) { if(a bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;} //------------------------------------------------------- int N; ll X[202020],Y[202020]; ll mo=998244353; template class BIT_mod { public: V bit[1<=mo)?mo:0; e+=e&-e;}} }; BIT_mod bt; void solve() { int i,j,k,l,r,x,y; string s; cin>>N; FOR(i,N) { cin>>x>>y; X[i]=x+y; Y[i]=x-y; } for(i=N-1;i>=0;i--) { X[i]-=X[0]; Y[i]-=Y[0]; } if(X[N-1]<0) { FOR(i,N) X[i]=-X[i]; } if(Y[N-1]<0) { FOR(i,N) Y[i]=-Y[i]; } vector Ys; vector> P; FOR(i,N) { if(X[i]X[N-1]) continue; if(Y[i]Y[N-1]) continue; Ys.push_back(Y[i]); } sort(ALL(Ys)); FOR(i,N) { if(i==0) continue; if(X[i]X[N-1]) continue; if(Y[i]Y[N-1]) continue; Y[i]=lower_bound(ALL(Ys),Y[i])-Ys.begin(); P.push_back({X[i],Y[i]}); } sort(ALL(P)); ll ret; bt.add(0,1); FORR2(x,y,P) { ret=bt(y); bt.add(y,ret); } cout<