#417. zoto
zoto
Description
You are given an array . For each , we use a point in coordinate plane to described it. You are asked to answer queries, in each query there will be a rectangle and you need to count how many different y-cooordinate (of the points mentioned above) in the queried rectangle.
Format
Input
The first line contains an integer representing the number of test cases. For each test case , there are two integers in the first line. Then one line contains integers Each of the next lines contain four integers which means matrix's lower-leftmost cell is and upper-rightest cell is .
Output
For each test case print a single integer in a new line.
Samples
1
4 2
1 0 3 1
1 0 4 3
1 0 4 2
3
2