public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  int t = sc . nextInt ( ) ;
  while ( t > 0 ) {
    int a = sc . nextInt ( ) ;
    int b = sc . nextInt ( ) ;
    int x = sc . nextInt ( ) ;
    int y = sc . nextInt ( ) ;
    int n = sc . nextInt ( ) ;
    int temp1a = a ;
    int temp1b = b ;
    int diff = 0 ;
    int tempn = n ;
    diff = Math . min ( tempn , ( a - x ) ) ;
    temp1a -= diff ;
    tempn -= diff ;
    diff = Math . min ( tempn , ( b - y ) ) ;
    temp1b -= diff ;
    tempn -= diff ;
    tempn = n ;
    int temp2a = a ;
    int temp2b = b ;
    diff = 0 ;
    diff = Math . min ( tempn , ( b - y ) ) ;
    temp2b -= diff ;
    tempn -= diff ;
    diff = Math . min ( tempn , ( a - x ) ) ;
    temp2a -= diff ;
    tempn -= diff ;
    System . out . println ( Math . min ( 1L * temp2a * temp2b * 1L , 1L * temp1b * temp1a * 1L ) ) ;
    t -- ;
  }
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int t = sc . nextInt ( ) ; while ( t > 0 ) { int a = sc . nextInt ( ) ; int b = sc . nextInt ( ) ; int x = sc . nextInt ( ) ; int y = sc . nextInt ( ) ; int n = sc . nextInt ( ) ; int temp1a = a ; int temp1b = b ; int diff = 0 ; int tempn = n ; diff = Math . min ( tempn , ( a - x ) ) ; temp1a -= diff ; tempn -= diff ; diff = Math . min ( tempn , ( b - y ) ) ; temp1b -= diff ; tempn -= diff ; tempn = n ; int temp2a = a ; int temp2b = b ; diff = 0 ; diff = Math . min ( tempn , ( b - y ) ) ; temp2b -= diff ; tempn -= diff ; diff = Math . min ( tempn , ( a - x ) ) ; temp2a -= diff ; tempn -= diff ; System . out . println ( Math . min ( 1L * temp2a * temp2b * 1L , 1L * temp1b * temp1a * 1L ) ) ; t -- ; } }
(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)))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (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: (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) (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: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (identifier)) right: (decimal_integer_literal)) (binary_expression left: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (identifier)) right: (decimal_integer_literal))))))) (expression_statement (update_expression (identifier)))))))