#include using namespace std; typedef long long ll; void solve(){ ll n ; cin>>n; unordered_map challenge; for(int i = 0 ; i < n; i++){ int diff; cin >> diff; int typ ; cin>>typ; challenge.insert({diff,typ}); } int heros; cin>>heros; for(int i = 0; i < heros; i++){ int power; cin>>power; int weaknes ; cin>>weaknes; int count = 0 ; for(auto x : challenge){ if(power >= x.first && x.second != weaknes) count++; } cout<