// BISMILLAH // created by kamran // Date: 2026-01-19 21:36 #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 signed main() { fast; int n; cin>>n; vector>x(n); for(int i=0;i>x[i].first; cin>>x[i].second; } sort(x.begin(),x.end()); vector>type; maptemp; for(int i=0;i>m; while(m--){ int a,b; cin>>a>>b; int low=0; int high=n-1; while(low<=high){ int mid=low+(high-low)/2; if(x[mid].first<=a)low=mid+1; else high=mid-1; } int ans=high+1; ans-=type[high][b]; //cout<