链接:https://ac.nowcoder.com/acm/contest/106/H?&headNav=www
来源:牛客网
It’s universally acknowledged that there’re innumerable trees in the campus of HUST.
There is a new leisure ground at the gate of HUST. The president of HUST wants to plant a group of trees on the ground and he wants the trees to be planted exactly like a square matrix. And then the gardens start their work. In the next N days, the gardens can water a tree in coordinate: (x, y) and it makes the height of the tree grows H. Sometimes, the president wants to know how magnificent his trees are. The president will give the gardens two coordinates: (x1, y1), (x2, y2). The gardens should report the sum of the heights of the trees in the sub matrix represents by the two coordinates. There will be A days that the gardens will water a tree. And there will be Q days that the pre