eolymp
bolt
Try our new interface for solving problems
Problems

Railways

Railways

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. \InputFile First, given the number of test cases\textbf{ Т} (no more than\textbf{ 10}). Next \textbf{- Т} groups of \textbf{8 }real numbers:\textbf{ V_1} - speed of the first ended,\textbf{ V_2}- сrate of the second composition,\textbf{ L_1} - length of the first composition, \textbf{L_2 }- length of the second composition, \textbf{X_1, Y_1} - the coordinates of "head" of the first composition, \textbf{X_2, Y_2} - the coordinates "head" of the second train. All the numbers do not exceed \textbf{5000}, are given in a single line through the gap. \OutputFile The program displays for each test \textbf{1}, if the tragedy occurred, and \textbf{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\textbf{ 0}.
Time limit 1 second
Memory limit 64 MiB
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, г. Бердичев