#include #include #include #include #define ls id<<1,l,mid #define rs id<<1|1,mid+1,r #define ll long long #define Maxn 100010 using namespace std; struct point{ int x,y,z,id; void read(){ scanf("%d%d%d",&x,&y,&z); } bool operator<(const point a)const{ if(x==a.x) return y>1; if(a<=mid) update(ls,a,b); else update(rs,a,b); } int res; void ask_rank(int k,int x){ if(!k) return; if(x==tr[k].v){ res+=tr[tr[k].l].s+tr[k].w; return; } else if(x>1; int ans=0; if(a<=mid) ans+=query(ls,a,b,x); if(b>mid) ans+=query(rs,a,b,x); return ans; } int ans[Maxn]; int main() { //cout<<3000000*16/1024<>t; while(t--){ memset(tr,0,sizeof tr); memset(root,0,sizeof root); sz=0; cin>>n; for(int i=0;i