Server Time: Mon Apr 23, 2018 3:44 am
Welcome ( logout
1107 - How Cow
  PDF (English) Statistics Forum
Time Limit: 2 second(s) Memory Limit: 32 MB

Mr Kopa Samsu is a farmer. He has a land of rectangular shape. But there are cows that disturb him a lot. The cows use to enter his land and ruin his crops. Now Mr Kopa Samsu has become smarter. He has a GPS system that will help him to know the position of the cows. So, you can think his land as a 2D grid, and cows can be treated as points. Now you are given the information of his land and cows. You have to tell him whether a cow is inside his land or not.


Input starts with an integer T (≤ 50), denoting the number of test cases.

The first line of each case contains four integers x1 y1 x2 y2, where (x1, y1) is the lower left coordinate of his land and (x2, y2) is the upper right coordinate of his land. You can assume that the sides of the land are axis parallel. The next line contains an integer M (1 ≤ M ≤ 100) denoting the number of cows. Each of the next M lines contains two integers each denoting x y - the position of a cow. You can safely assume that no cow will lie on the boundary of the rectangle. All the coordinates will lie in the range [0, 10000].


For each case you have to print the case number in a line first. Then for each cow, you have to print 'Yes' or 'No' depending whether the cow is inside the land or not.

Sample Input

Output for Sample Input


1 2 8 10


0 0

5 6

1 0

7 9

3 5

10 10

1 11

Case 1:









Problem Setter: Jane Alam Jan
Developed and Maintained by
Copyright © 2012
LightOJ, Jane Alam Jan