#include using namespace std; using ll=long long; #include using atcoder::lazy_segtree; ll op(ll x,ll y){ return x+y; } ll e(){ return 0; } int main(){ int n,m; cin>>n>>m; vector a(n); vector l(n),r(n); for(int i=0;i>a[i]>>l[i]>>r[i]; l[i]--; } int q; cin>>q; vector vv(n,-1); for(int i=0;i st(m),st2(m); for(int i=0;i>x>>y>>u>>v; x--;y--;u--; ans-=a[x]*(r[x]-l[x]); //cout<