public static long calc ( long i1 , long i2 ) {
  long [ ] ss = new long [ 3 ] ;
  long ans = Long . MAX_VALUE ;
  long sMax , sMin ;
  for ( int j = 1 ;
  j < i1 ;
  j ++ ) {
    ss [ 0 ] = j * i2 ;
    for ( int k = 0 ;
    k < 2 ;
    k ++ ) {
      sMax = Long . MIN_VALUE ;
      sMin = Long . MAX_VALUE ;
      if ( k == 0 ) ss [ 1 ] = ( i1 - j ) * ( i2 / 2 ) ;
      else ss [ 1 ] = ( ( i1 - j ) / 2 ) * i2 ;
      ss [ 2 ] = ( i1 * i2 ) - ( ss [ 0 ] + ss [ 1 ] ) ;
      for ( int i = 0 ;
      i < 3 ;
      i ++ ) {
        if ( sMax < ss [ i ] ) sMax = ss [ i ] ;
        if ( sMin > ss [ i ] ) sMin = ss [ i ] ;
      }
      if ( ans > ( sMax - sMin ) ) ans = sMax - sMin ;
    }
  }
  return ans ;
}

public static long calc ( long i1 , long i2 ) { long [ ] ss = new long [ 3 ] ; long ans = Long . MAX_VALUE ; long sMax , sMin ; for ( int j = 1 ; j < i1 ; j ++ ) { ss [ 0 ] = j * i2 ; for ( int k = 0 ; k < 2 ; k ++ ) { sMax = Long . MIN_VALUE ; sMin = Long . MAX_VALUE ; if ( k == 0 ) ss [ 1 ] = ( i1 - j ) * ( i2 / 2 ) ; else ss [ 1 ] = ( ( i1 - j ) / 2 ) * i2 ; ss [ 2 ] = ( i1 * i2 ) - ( ss [ 0 ] + ss [ 1 ] ) ; for ( int i = 0 ; i < 3 ; i ++ ) { if ( sMax < ss [ i ] ) sMax = ss [ i ] ; if ( sMin > ss [ i ] ) sMin = ss [ i ] ; } if ( ans > ( sMax - sMin ) ) ans = sMax - sMin ; } } return ans ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (decimal_integer_literal))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (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 (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (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: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))))) alternative: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (decimal_integer_literal))) right: (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (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: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))) consequence: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))))))))) (return_statement (identifier))))