#include #define MX 5000000 using namespace std; typedef long long ll; typedef unsigned long long ull; int const md=1e9+7; struct city { ll p; int l; int cvr; }; struct cloud { ll l; int r; }; bool comp(city x,city y) { return x.l>t; while(t--) { int n,m; cin>>n; city ct[n]; for(int i=0;i>ct[i].p; } for(int i=0;i>ct[i].l; ct[i].cvr=0; } cin>>m; cloud cd[m]; for(int i=0;i>cd[i].l; } for(int i=0;i>cd[i].r; } sort(ct,ct+n,comp); sort(cd,cd+m,comp2); int p=0,q; int mxp=-1; for(int i=0;i=left && ct[p].l<=right &&p