#ds105. 二维树状数组
二维树状数组
2D Fenwick Tree
Problem Description
You are given numbers $a_{1, 1}, a_{1, 2}, a_{1, 3}, \dots, a_{1, m}, \dots, a_{n, m}$.
Support operations:
1 x y d: set .2 x y: query .
Input Format
The first line contains three integers ().
The next lines each contain integers $a_{1, 1}, a_{1, 2}, \dots, a_{1, m}, \dots, a_{n, m}$ ().
The next lines each contain an operation of the form 1 x y d or 2 x y, with guaranteed.
Output Format
For each query, output one line containing the answer.
Sample Input
2 3 5
1 1 4
5 1 4
2 2 3
1 1 1 4
2 1 3
1 2 3 10
2 2 3
Sample Output
16
9
25