Count Online#2952

Count Online

6 seconds
256 megabytes
Very easy

You are given a set of points on a plane.

You need to handle two types of queries:

Input

The number of points is (1 \leq N \leq 50000). Next, points follow. The number of queries is (1 \leq Q \leq 100000). Next, queries follow. All coordinates are within the range to 10^9.

Output

For each ? query, output a single integer — the number of points inside the specified rectangle.

Examples

Example 1

Loading
Loading