Time Limit: 14000/7000 MS (Java/Others)

Memory Limit: 65536/65536 K (Java/Others)

Xuejiejie loves to eat fish. One day, she goes to a pond for fishing. The pond can be seen as a two-dimensional surface, and her fishing net can be seen as a rectangle. One of the edges of the rectangle is parallel to the x-axis ,and another is parallel to y-axis. The fishes can be seen as points. Sometimes the fishes will enter the net, and sometimes they will leave the net. So, Xuejiejie doesn't know the appropriate time to draw the net in when she will get as many fishes as possible.

Xuejiejie assigns each fish with a number, from 1 to $n$, $n$ being the total number. There are 2 types of movements of the fishes:

1 l r d : the fishes index between the interval [l，r] moved towards the x-axis for length d (For example , if a fish's current position is $(x,y)$ , after moving , its position will change to $(x+d,y)$. )

2 l r d : the fishes index between the interval [l，r] moved towards the y-axis for length d (For example , if a fish's current position is $(x,y)$, after moving , its position will change to $(x,y+d)$. )

And sometimes Xuejiejie will ask you some questions.

Xuejiejie assigns each fish with a number, from 1 to $n$, $n$ being the total number. There are 2 types of movements of the fishes:

1 l r d : the fishes index between the interval [l，r] moved towards the x-axis for length d (For example , if a fish's current position is $(x,y)$ , after moving , its position will change to $(x+d,y)$. )

2 l r d : the fishes index between the interval [l，r] moved towards the y-axis for length d (For example , if a fish's current position is $(x,y)$, after moving , its position will change to $(x,y+d)$. )

And sometimes Xuejiejie will ask you some questions.

In the first line there is an integer $T$, indicates the number of test cases.

In each case:

The first line includes an integer $n$ indicating the total number of fish.

The second line includes 4 integers $x1$，$y1$，$x2$，$y2$，indicating the position of the fishing net. $(x1,y1)$ means the lower-left position, and $(x2,y2)$ means the top-right position.

The next n lines: each line includes $x[i],y[i]$; means the fish i's initial position.

The next line includes an integer $m$.

The next $m$ lines describe the events you have to deal with.

In each line the first integer is $c$ ($1\leq c\leq 3$), which indicates the type of events.

1 l r d : the fish index between the interval [l，r] moved towards the x-axis for length d

2 l r d : the fish index between the interval [l，r] moved towards the y-axis for length d

3 l r : query the number of the fish index between the interval [l，r] which are in the net(including the one in the border)

$1\leq n, m\leq 100000$, $1\leq l\leq r\leq n$. $1\leq d\leq 10^9$, $x1\leq x2$, $y1\leq y2$。 Ensure that any time all involved coordinate values in the range of$[-10^9,10^9]$。

In each case:

The first line includes an integer $n$ indicating the total number of fish.

The second line includes 4 integers $x1$，$y1$，$x2$，$y2$，indicating the position of the fishing net. $(x1,y1)$ means the lower-left position, and $(x2,y2)$ means the top-right position.

The next n lines: each line includes $x[i],y[i]$; means the fish i's initial position.

The next line includes an integer $m$.

The next $m$ lines describe the events you have to deal with.

In each line the first integer is $c$ ($1\leq c\leq 3$), which indicates the type of events.

1 l r d : the fish index between the interval [l，r] moved towards the x-axis for length d

2 l r d : the fish index between the interval [l，r] moved towards the y-axis for length d

3 l r : query the number of the fish index between the interval [l，r] which are in the net(including the one in the border)

$1\leq n, m\leq 100000$, $1\leq l\leq r\leq n$. $1\leq d\leq 10^9$, $x1\leq x2$, $y1\leq y2$。 Ensure that any time all involved coordinate values in the range of$[-10^9,10^9]$。

提交代码