Points in a rectangle

0

0 votes
Easy
Problem

Given a rectangle with sides parallel to X and Y axis and N points in X-Y co-ordinates, print the total number of points that lie strictly inside the rectangle.

Input

The first line consist of a single integer T - the number of test cases.
For every test case the input is as follows -
First Line consists of x1 y1 x2 y2 - (x1, y1) and (x2, y2) are opposite corner points of the rectangle.
Next line consists of N
N lines follows - each line containing - X Y coordinate of the point.

Output

Output in T lines, the answer to each test case.

Constraints

1<=T, N<=10^6
-10^9<=X, Y values<=10^9
Note - The sum of N over all test cases donot exceed 10^6

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?