To help build a new home for Mr. DeMello Santa, you were tasked with maintaining a 2D,
In this tank, you will be asked to perform
1 x y
: Add one new cookie to the tank of milk at position
2 x1 y1 x2 y2
: Add sprinkles to all the cookies once in the rectangle from
Can you help Santa determine the sum of the sprinkles placed on the cookies?
Input Specification
The first line will contain
The next
For type
For type
Note: One cell can contain multiple cookies.
Output Specification
Output the sum of the sprinkles placed on the cookies.
Sample Input
6 6
1 2 3
1 5 6
2 2 3 5 6
1 4 4
2 2 3 4 4
2 2 3 5 6
Sample Output
7
Explanation for Sample Output
In all the queries, the cookie at
Comments