#include #include #include #include using namespace std; typedef long long LL; const int maxn=100005; LL n,w,h,a[maxn<<1],cnt; struct Data { LL x,y1,y2,c; Data() { } Data(LL _x,LL _y1,LL _y2,LL _c):x(_x),y1(_y1),y2(_y2),c(_c) { } } li[maxn<<1]; inline bool operator<(const Data &a,const Data &b) { return a.x>1; PushDown(o); if(pl<=M) update(Lc(o),L,M); if(pr>M) update(Rc(o),M+1,R); PushUp(o); } void solve() { LL res=0,x,y,c; cnt=0; for(int i=0;i