We have a robot and an obstacle in a 2-dimensional plane. The robot is an axis-aligned (rectilinear) square, and the obstacle is a rectilinear polygon, meaning every edge is either horizontal or vertical. Initially the robot lies completely outside the obstacle: it does not touch the boundary and is not in the interior.
The robot wants to escape the obstacle by translating in horizontal or vertical directions without ever intersecting it. The robot has escaped once it lies completely outside the smallest axis-aligned rectangle that contains the obstacle (see Figure 1 and Figure 2). The robot may already start outside that rectangle.
In Figure 1 the robot cannot escape, but in Figure 2 it can. R marks the robot and P marks the obstacle. Let (x,y) be a vertex of P; then x and y are both multiples of 10 with 10≤x,y≤1,000,000. The side length of R is a natural number below 1,000,000 whose last digit is always 2 (for example 2,12,22,32,…).

Figure 1

Figure 2
Write a program that decides whether the robot can escape the obstacle.
The first line contains the number of test cases T.
Each test case is given as follows. The first line contains three integers nx, ny, and w (2≤nx,ny,w≤1,000,000), where (nx,ny) is the bottom-left corner of the robot R and w is its side length, whose last digit is always 2. The second line contains an integer n (4≤n≤1,000), the number of vertices of the rectilinear polygon P. Each of the next n lines gives one vertex of P in counterclockwise order as two integers x and y (10≤x,y≤1,000,000, both multiples of 10). In every test case the robot starts outside P.
For each test case, print YES on its own line if the robot can escape the obstacle, or NO otherwise.