Submit solution
Points:
15 (partial)
Time limit:
2.0s
Java
2.5s
Python
2.5s
Memory limit:
512M
Author:
Problem type
You are given a -dimensional grid of size , and queries:
. This means adding to all elements in the subgrid starting at and ending at . .
. This query asks for the value of the element at position . .
All elements in the grid start off at a value of .
Input Specification
The first line will contain two integers .
The next lines will each contain a valid query as described above.
Output Specification
For each type query, output the value of the element at position on its own line.
Subtasks
Subtask 1 [10%]
Subtask 2 [30%]
Subtask 3 [60%]
No further constraints.
Sample Input
4 6
1 1 1 3 3 2
2 3 3
1 2 3 4 4 1
1 3 3 3 3 100
2 4 4
2 2 3
Sample Output
2
1
3
Comments