{ map<ll,ll>amap; ll@h,@w,@q,n=h*w; rep(q){ ll@y,@x; y=h+1-y; if(amap[x]<y){ n-=y-amap[x]; amap[x]=y; } wt(n); } }