High School Programming League 2011/2012

Inside or outside

Problem code: HS11IO

Given an ellipse E and a point P on the plane decide if:

  1. P belongs to E.
  2. P belongs to the interior of E.
  3. P belongs to the exterior of E.

Input

First t < 1000, the number of test cases. In each of the following t lines, 6 integers: -100 <= Ex, Ey <= 100 (coordinates of the center of the ellipse), 0 < a <= 100 (the length of the semi-axis parallel to the x-axis), 0 < b <= 100 (the length of the semi-axis parallel to the y-axis), -100 <= Px, Py <= 100 (the coordinates of P).

Output

For each test, output one number 1, 2 or 3 in a separate line, denoting the appropriate case, as enumerated above.

Example

Input:
4
0 0 5 10 3 8
0 0 5 10 5 0
0 0 5 5 4 4
-10 -10 7 2 -10 -10 

Output:
1
1
3
2

Scoring

By solving this problem you score 10 points.


Added by:Łukasz Kuszner
Date:2011-11-20
Time limit:1s
Source limit:50000B
Languages:All except: SED AWK
Resource:High School Programming League
SPOJ System © 2010 Sphere Research Labs. All Rights Reserved.