Count Online
You are given a set of points on a plane and need to handle two types of queries:
? x_1 y_1 x_2 y_2 — Determine how many points lie within the rectangle defined by [x_1..x_2] and [y_1..y_2]. Points on the boundary and corners are included. It is guaranteed that x_1 ≤ x_2 and y_1 ≤ y_2.
+ x y — Add the point (x + res % 100, y + res % 101) to the set, where res is the result of the most recent ? query, and % denotes the modulo operation.
Input
The input begins with the number of points N (1 ≤ N ≤ 50000), followed by N points. Next, the number of queries Q (1 ≤ Q ≤ 100000) is given, followed by Q queries. All coordinates are within the range of 0 to 10^9.
Output
For each ? query, output a single integer representing the number of points inside the specified rectangle.