SICRANO - Sicrano

no tags 

Sicrano has a problem ... a geometry problem. He is not a very good in this area, so he's asking for your help.

Given a set of points and a set of segments, tell, for each segment, how much points lie in it.

Input

The first integer T (T <= 20) in the input says that there are T test cases in the input. Each test case begins with two integer N and M (1 <= N, M <= 50). N means how many points exists in that test case, and M means how many segments exists in that test case. The next N pairs of integers represents the points. Each pair describes the coordinates x and y of a point. (0 <= x, y <= 100). After that, the segments will be listed. Each segment is described by the coordinates of its two extreme points. All values in the input are integers. See the sample input for clarification.

Output

For each segment, print how many points are in it.

Example

Input:
1

4 3

1 1
2 2
3 3
4 4

0 0 5 5
3 3 4 4
0 0 1 0 Output: 4
2
0

hide comments
akb: 2012-09-06 12:19:05

Don't know why i read the comment before solving it...:(

:D: 2012-06-16 09:47:44

Some of the Paulo Costa problems have issues with the description. This is NOT one of them. Everything is precise and clear.

PubLic_AvenGeR: 2012-04-16 16:58:32

Read d problem statement carefully.The test cases are sufficient.Read the output line once again.

Last edit: 2012-04-16 16:58:48

Added by:Paulo Costa
Date:2012-01-19
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:UFPE