eolymp
bolt
Try our new interface for solving problems
Problems

Railways

Railways

Time limit 1 second
Memory limit 64 MiB

Two railways intersect at right angles. The origin is at the point of intersection, and the coordinate axes coincide with the rails. For pretovrascheniya accidents at the intersection of the dispatcher on duty, but as so often happens, he fell asleep on Berufsbekleidung place. At this time two trains speeding toward each other in different ways. Known speed of trains, their length and the initial coordinates "head" of each composition, at this initial coordinates are positive.

Identify or possible disaster.

Input data

First, given the number of test cases Т (no more than 10). Next - Т groups of 8 real numbers: V_1 - speed of the first ended, V_2- сrate of the second composition, L_1 - length of the first composition, L_2 - length of the second composition, X_1, Y_1 - the coordinates of "head" of the first composition, X_2, Y_2 - the coordinates "head" of the second train. All the numbers do not exceed 5000, are given in a single line through the gap.

Output data

The program displays for each test 1, if the tragedy occurred, and 0, if everything went well. All numbers are displayed in one line without spaces between them, as well as at the beginning and end of the line. If the "head" of one train glide by the "tail" of another, then assume that everything was easy to fear, and therefore deduce 0.

Examples

Input example #1
2 10 50 200 200 0 15 100 0 1002 10 10 1000 10 0 0 1000
Output example #1
10
Source II этап Всеукраинской олимпиады школьников 2008-2009, г. Бердичев