{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"There is a matrix containing at most 106\nelements divided into r rows and c columns. Each element\nhas a location (x, y) where 1 ≤ x ≤ r, 1 ≤ y ≤ c. Initially, all the elements are zero. You need to\nhandle four kinds of operations:\n1 x1 y1 x2 y2 v Increment each element (x, y) in submatrix (x1, y1, x2, y2) by v (v \u003e\n0)\n2 x1 y1 x2 y2 v Set each element (x, y) in submatrix (x1, y1, x2, y2) to v\n3 x1 y1 x2 y2 Output the summation, min value and max value of submatrix\n(x1, y1, x2, y2)\nIn the above descriptions, submatrix (x1, y1, x2, y2) means all the elements (x, y) satisfying x1 ≤\nx ≤ x2 and y1 ≤ x ≤ y2. It is guaranteed that 1 ≤ x1 ≤ x2 ≤ r, 1 ≤ y1 ≤ y2 ≤ c. After any operation,\nthe sum of all the elements in the matrix does not exceed 109\n.\nInput\nThere are several test cases. The first line of each case contains three positive integers r, c, m, where\nm (1 ≤ m ≤ 20, 000) is the number of operations. Each of the next m lines contains a query. There\nwill be at most twenty rows in the matrix. The input is terminated by end-of-file (EOF).\nOutput\nFor each type-3 query, print the summation, min and max."}}]}