private static int temp ( int N , int M , int stones ) {
  int diff = 2 * N + 2 * M - 4 - stones ;
  int d1 = diff / 4 ;
  int d2 = ( diff + 1 ) / 4 ;
  int d3 = ( diff + 2 ) / 4 ;
  int d4 = ( diff + 3 ) / 4 ;
  int newEnclosed = 0 ;
  for ( int n = 0 ;
  n < N ;
  n ++ ) {
    for ( int m = 0 ;
    m < M ;
    m ++ ) {
      if ( n + m >= d1 && n + ( M - 1 - m ) >= d2 && ( N - 1 - n ) + ( M - 1 - m ) >= d3 && ( N - 1 - n ) + m >= d4 ) {
        newEnclosed ++ ;
      }
    }
  }
  return newEnclosed ;
}

private static int temp ( int N , int M , int stones ) { int diff = 2 * N + 2 * M - 4 - stones ; int d1 = diff / 4 ; int d2 = ( diff + 1 ) / 4 ; int d3 = ( diff + 2 ) / 4 ; int d4 = ( diff + 3 ) / 4 ; int newEnclosed = 0 ; for ( int n = 0 ; n < N ; n ++ ) { for ( int m = 0 ; m < M ; m ++ ) { if ( n + m >= d1 && n + ( M - 1 - m ) >= d2 && ( N - 1 - n ) + ( M - 1 - m ) >= d3 && ( N - 1 - n ) + m >= d4 ) { newEnclosed ++ ; } } } return newEnclosed ; }
(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)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (binary_expression left: (decimal_integer_literal) right: (identifier))) right: (decimal_integer_literal)) right: (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (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 (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 (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) right: (binary_expression left: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)))) right: (identifier))) right: (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier))) right: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)))) right: (identifier))) right: (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier))) right: (identifier)) right: (identifier)))) consequence: (block (expression_statement (update_expression (identifier))))))))) (return_statement (identifier))))