#include #include #include #include using namespace std; int main(){ int N, M; cin >> N; vector>Members(N); for(int i=0; i> ai >> bi; Members[i].first=ai; Members[i].second=bi; } cin >> M; vector>Mentaiko(M); for(int i=0; i> xi >> yi; Mentaiko[i].first=xi; Mentaiko[i].second=yi; } int maxcount=0; queueQ; for(int j=0; j=Mentaiko[j].first && Members[i].second<=Mentaiko[j].second){ tmpcount++; } } if(maxcount==tmpcount){ Q.push(j); } else if(maxcountEmptyQ; maxcount=tmpcount; Q.swap(EmptyQ); Q.push(j); } } if(Q.empty())cout << 0 << '\n'; else{ while(!Q.empty()){ cout << Q.front() << '\n'; Q.pop(); } } return 0; }