public static void main ( String [ ] args ) throws IOException {
  Scanner input = new Scanner ( System . in ) ;
  int n = input . nextInt ( ) ;
  int x1 , y1 , x2 , y2 ;
  x1 = y1 = Integer . MAX_VALUE ;
  x2 = y2 = Integer . MIN_VALUE ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    int a = input . nextInt ( ) ;
    int b = input . nextInt ( ) ;
    x1 = Math . min ( x1 , a ) ;
    y1 = Math . min ( y1 , b ) ;
    x2 = Math . max ( x2 , a ) ;
    y2 = Math . max ( y2 , b ) ;
  }
  if ( x1 == x2 || y1 == y2 ) {
    System . out . println ( "-1" ) ;
  }
  else {
    System . out . println ( Math . abs ( x2 - x1 ) * Math . abs ( y2 - y1 ) ) ;
  }
}

public static void main ( String [ ] args ) throws IOException { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int x1 , y1 , x2 , y2 ; x1 = y1 = Integer . MAX_VALUE ; x2 = y2 = Integer . MIN_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { int a = input . nextInt ( ) ; int b = input . nextInt ( ) ; x1 = Math . min ( x1 , a ) ; y1 = Math . min ( y1 , b ) ; x2 = Math . max ( x2 , a ) ; y2 = Math . max ( y2 , b ) ; } if ( x1 == x2 || y1 == y2 ) { System . out . println ( " - 1" ) ; } else { System . out . println ( Math . abs ( x2 - x1 ) * Math . abs ( y2 - y1 ) ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_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)) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))))) (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 (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)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))) alternative: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier))))))))))))