Logo Universal Online Judge

UOJ

时间限制:4 s 空间限制:976 MB
统计

对于数组d$[1..n,1..m]$(Pascal),我们有两个操作0和1。对于0 a1 b1 a2 b2 c操作,表示把满足a1<=i<=a2,b1<=j<=b2的d[i,j]增加c;对于1 a1 b1 a2 b2操作,表示询问满足a1<=i<=a2,b1<=j<=b2的d[i,j]的和。
Input
第一行三个数n,m,r(1<=n,m<=5000,1<=r<=100000),n,m如题,r表示操作个数。接下来r行描述操作。对于0操作1<=a1<=a2<=n,1<=b1<=b2<=m,1<=c<=10000;对于1操作,1<=a1<=a2<=n,1<=b1<=b2<=m。所有数均为整数。保证运算过程中所有数不超过2^63-1。
Output
对于每个1操作,输出一行一个整数,为所求答案。
Sample Input
3 3 2
0 1 1 2 2 1
1 2 2 3 3
Sample Output
1