static int solve ( int [ ] c , int b ) {
  int res = 0 ;
  for ( int i = 0 ;
  i < 2 ;
  i ++ ) {
    if ( c [ 0 ] > b ) {
      res += c [ 0 ] - b ;
      c [ 1 ] += c [ 0 ] - b ;
      c [ 0 ] = b ;
    }
    if ( c [ 1 ] > b ) {
      res += c [ 1 ] - b ;
      c [ 2 ] += c [ 1 ] - b ;
      c [ 1 ] = b ;
    }
    if ( c [ 2 ] > b ) {
      res += c [ 2 ] - b ;
      c [ 0 ] += c [ 2 ] - b ;
      c [ 2 ] = b ;
    }
  }
  return res ;
}

static int solve ( int [ ] c , int b ) { int res = 0 ; for ( int i = 0 ; i < 2 ; i ++ ) { if ( c [ 0 ] > b ) { res += c [ 0 ] - b ; c [ 1 ] += c [ 0 ] - b ; c [ 0 ] = b ; } if ( c [ 1 ] > b ) { res += c [ 1 ] - b ; c [ 2 ] += c [ 1 ] - b ; c [ 1 ] = b ; } if ( c [ 2 ] > b ) { res += c [ 2 ] - b ; c [ 0 ] += c [ 2 ] - b ; c [ 2 ] = b ; } } return res ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (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: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (identifier))))))) (return_statement (identifier))))