#include #include using namespace std; using namespace atcoder; using ll=long long; using ldub=long double; using lldub=__float128; using str=string; using mint=modint; template using tup2=tuple; template using tup3=tuple; template using tup4=tuple; template using tup5=tuple; template using tup6=tuple; template using tup7=tuple; template using vec=vector; template using vec2=vector>; template using vec3=vector>; template using vec4=vector>; template using vec5=vector>; template using vec6=vector>; template using que=queue; template using Pque=priority_queue; template using pque=priority_queue, greater>; struct Edge{ ll from,to,w=1,num=-1; }; using gvec=vector; using gvec2=vector; template bool chmax(T &a,T b){if(a bool chmin(T &a,T b){if(b> H >> W >> N; vec2 F(H+1,vec(W+1)); for(ll i=0;i> a >> b >> c >> d; a--,b--; F[a][b]++,F[a][d]--,F[c][b]--,F[c][d]++; } for(ll i=0;i<=H;i++){ for(ll j=0;j<=W;j++){ if(i!=0) F[i][j]+=F[i-1][j]; if(j!=0) F[i][j]+=F[i][j-1]; if(i!=0&&j!=0) F[i][j]-=F[i-1][j-1]; } } ll c=0; for(ll i=0;i> T; while(T--) solve(); return 0; }