public static void main ( String [ ] args ) {
  Scanner input = new Scanner ( System . in ) ;
  int test = input . nextInt ( ) ;
  int a = 0 ;
  int b = 0 ;
  int c = 0 ;
  int d = 0 ;
  int x = 0 ;
  int y = 0 ;
  int x1 = 0 ;
  int y1 = 0 ;
  int x2 = 0 ;
  int y2 = 0 ;
  int sumV = 0 ;
  int sumH = 0 ;
  for ( int t = 0 ;
  t < test ;
  t ++ ) {
    a = input . nextInt ( ) ;
    b = input . nextInt ( ) ;
    c = input . nextInt ( ) ;
    d = input . nextInt ( ) ;
    x = input . nextInt ( ) ;
    y = input . nextInt ( ) ;
    x1 = input . nextInt ( ) ;
    y1 = input . nextInt ( ) ;
    x2 = input . nextInt ( ) ;
    y2 = input . nextInt ( ) ;
    String answer = "Yes" ;
    sumV = d - c ;
    sumH = b - a ;
    if ( x1 == x2 && a + b > 0 ) {
      answer = "No" ;
    }
    if ( y1 == y2 && c + d > 0 ) {
      answer = "No" ;
    }
    if ( sumV != 0 ) {
      if ( sumV > 0 ) {
        if ( y + sumV > y2 ) {
          answer = "No" ;
        }
      }
      else if ( sumV < 0 ) {
        if ( y + sumV < y1 ) {
          answer = "No" ;
        }
      }
    }
    if ( sumH != 0 ) {
      if ( sumH > 0 ) {
        if ( x + sumH > x2 ) {
          answer = "No" ;
        }
      }
      else if ( sumH < 0 ) {
        if ( x + sumH < x1 ) {
          answer = "No" ;
        }
      }
    }
    System . out . println ( answer ) ;
  }
}

public static void main ( String [ ] args ) { Scanner input = new Scanner ( System . in ) ; int test = input . nextInt ( ) ; int a = 0 ; int b = 0 ; int c = 0 ; int d = 0 ; int x = 0 ; int y = 0 ; int x1 = 0 ; int y1 = 0 ; int x2 = 0 ; int y2 = 0 ; int sumV = 0 ; int sumH = 0 ; for ( int t = 0 ; t < test ; t ++ ) { a = input . nextInt ( ) ; b = input . nextInt ( ) ; c = input . nextInt ( ) ; d = input . nextInt ( ) ; x = input . nextInt ( ) ; y = input . nextInt ( ) ; x1 = input . nextInt ( ) ; y1 = input . nextInt ( ) ; x2 = input . nextInt ( ) ; y2 = input . nextInt ( ) ; String answer = " Yes " ; sumV = d - c ; sumH = b - a ; if ( x1 == x2 && a + b > 0 ) { answer = " No " ; } if ( y1 == y2 && c + d > 0 ) { answer = " No " ; } if ( sumV != 0 ) { if ( sumV > 0 ) { if ( y + sumV > y2 ) { answer = " No " ; } } else if ( sumV < 0 ) { if ( y + sumV < y1 ) { answer = " No " ; } } } if ( sumH != 0 ) { if ( sumH > 0 ) { if ( x + sumH > x2 ) { answer = " No " ; } } else if ( sumH < 0 ) { if ( x + sumH < x1 ) { answer = " No " ; } } } System . out . println ( answer ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (string_literal))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (string_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (string_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (string_literal)))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (string_literal)))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (string_literal)))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (string_literal)))))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))))