SP205 ICERINK - Icerink
Description
A skating competition was organized on the largest icerink in Byteland. The icerink is a square of size 10000 \* 10000. A competitor begins skating at the START point chosen by referees and his task is to finish sliding at the FINISH point, also chosen by referees. The points of START and FINISH are different. One can slide in directions parallel to the sides of the icerink. There are some obstacles placed on the icerink. Each obstacle is a prism, which base is a polygon with sides parallel to the sides of the icerink. Each two adjacent sides of the base are always perpendicular. The obstacles do not have common points. Each slide finishes up at the point where a competitor, for the first time, meets the wall of an obstacle, which is perpendicular to the direction of the slide. In other words, one can stop only when he crashes on a wall or in the FINISH point. Falling out of the icerink causes disqualification. Competitor may slide along walls of an obstacle.
  Decide, whether a competitor who slides according to the given rules may reach the finish point, assuming he begun sliding from the starting point. If so, what is the minimal number of slides he needs to do?
### Task
Write a program which:
- reads the description of the icerink, obstacles, and the coordinates of the start and finish point from the standard input,
- verifies, whether a competitor who begins from the starting point and slides according the rules may reach the finish point, and if so, computes the minimal number of slides he needs to do,
- writes the result in the standard output.
Input Format
The number of test cases t is in the first line of input, then t test cases follow separated by an empty line. We define a system of coordinates to describe positions of objects on a rink. The rink is a square with vertices (0,0),(10000,0),(10000,10000),(0,10000). In the first line of each test case there are two integers _z $ _{1} $_ and _z $ _{2} $_ separated by a single space, 0
Output Format
Your program should write for each test case:
- either one word 'NO' if it's impossible to get from the START point to the FINISH point
- or the minimal number of slides necessary to get to the FINISH point, if it is possible.