public static int solve ( int A , int B ) {
  int ans = Integer . MAX_VALUE ;
  for ( int one = - 4 ;
  one <= 4 ;
  one ++ ) {
    for ( int five = - 1 ;
    five <= 1 ;
    five ++ ) {
      for ( int ten = - 10 ;
      ten <= 10 ;
      ten ++ ) {
        if ( A + one + 5 * five + 10 * ten == B ) ans = Math . min ( ans , Math . abs ( one ) + Math . abs ( five ) + Math . abs ( ten ) ) ;
      }
    }
  }
  return ans ;
}

public static int solve ( int A , int B ) { int ans = Integer . MAX_VALUE ; for ( int one = - 4 ; one <= 4 ; one ++ ) { for ( int five = - 1 ; five <= 1 ; five ++ ) { for ( int ten = - 10 ; ten <= 10 ; ten ++ ) { if ( A + one + 5 * five + 10 * ten == B ) ans = Math . min ( ans , Math . abs ( one ) + Math . abs ( five ) + Math . abs ( ten ) ) ; } } } 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: (integral_type) declarator: (variable_declarator name: (identifier) value: (field_access object: (identifier) field: (identifier)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (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: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (binary_expression left: (decimal_integer_literal) right: (identifier))) right: (binary_expression left: (decimal_integer_literal) right: (identifier))) right: (identifier))) consequence: (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))))))))))) (return_statement (identifier))))