#include using namespace std; using ll = long long; int main(){ ll H, W, ans=0, N, M, X, Y, B, C; cin >> H >> W >> N >> M; vector T(N), U(N), L(N), R(N), A(N); for (int i=0; i> T[i] >> U[i] >> L[i] >> R[i] >> A[i]; vector> D(H+2, vector(W+2)); for (int i=0; i> X >> Y >> B >> C; ll a, b, c, d; a = max(0LL, X-B); b = min(H+1, X+B+1); c = max(0LL, Y-B); d = min(W+1, Y+B+1); D[a][c] += C; D[a][d] -= C; D[b][c] -= C; D[b][d] += C; } for (int i=1; i<=H; i++){ for (int j=0; j<=W; j++){ D[i][j] += D[i-1][j]; } } for (int i=0; i<=H; i++){ for (int j=1; j<=W; j++){ D[i][j] += D[i][j-1]; } } for (int i=1; i<=H; i++){ for (int j=1; j<=W; j++){ D[i][j] += D[i-1][j] + D[i][j-1] - D[i-1][j-1]; } } for (int i=0; i