// BISMILLAH // AUTHOR: KAMRAN // Date: 2026-02-17 19:16 #include #include #include using namespace std; #define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define int long long #define nl endl void solve(){ int n; cin>>n; vector>x(n); for(int i=0;i>x[i].first>>x[i].second; } sort(x.begin(),x.end()); map>y; for(int i=0;i>m; while(m--){ pairz; cin>>z.first>>z.second; int total=upper_bound(x.begin(),x.end(),make_pair(z.first,LLONG_MAX))-x.begin(); int temp=z.second; int ele=upper_bound(y[temp].begin(),y[temp].end(),z.first)-y[temp].begin(); cout<