public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  int A = sc . nextInt ( ) ;
  int B = sc . nextInt ( ) ;
  int C = sc . nextInt ( ) ;
  int D = sc . nextInt ( ) ;
  int E = sc . nextInt ( ) ;
  int F = sc . nextInt ( ) ;
  Set < Integer > waterSet = new HashSet < > ( ) ;
  Set < Integer > sugarSet = new HashSet < > ( ) ;
  createSugar ( sugarSet , C , D , F ) ;
  createWater ( waterSet , A , B , F ) ;
  double maxRatio = - 1 ;
  int resultSugar = - 1 ;
  int resultWater = - 1 ;
  for ( int water : waterSet ) {
    for ( int sugar : sugarSet ) {
      if ( ( water + sugar ) <= F && sugar <= ( water / 100 ) * E ) {
        double ratio = ( ( double ) ( 100 * sugar ) ) / ( water + sugar ) ;
        if ( ratio > maxRatio ) {
          maxRatio = ( ( double ) ( 100 * sugar ) ) / ( water + sugar ) ;
          resultSugar = sugar ;
          resultWater = water ;
        }
      }
    }
  }
  System . out . println ( resultSugar + resultWater + " " + resultSugar ) ;
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int A = sc . nextInt ( ) ; int B = sc . nextInt ( ) ; int C = sc . nextInt ( ) ; int D = sc . nextInt ( ) ; int E = sc . nextInt ( ) ; int F = sc . nextInt ( ) ; Set < Integer > waterSet = new HashSet < > ( ) ; Set < Integer > sugarSet = new HashSet < > ( ) ; createSugar ( sugarSet , C , D , F ) ; createWater ( waterSet , A , B , F ) ; double maxRatio = - 1 ; int resultSugar = - 1 ; int resultWater = - 1 ; for ( int water : waterSet ) { for ( int sugar : sugarSet ) { if ( ( water + sugar ) <= F && sugar <= ( water / 100 ) * E ) { double ratio = ( ( double ) ( 100 * sugar ) ) / ( water + sugar ) ; if ( ratio > maxRatio ) { maxRatio = ( ( double ) ( 100 * sugar ) ) / ( water + sugar ) ; resultSugar = sugar ; resultWater = water ; } } } } System . out . println ( resultSugar + resultWater + " ▁ " + resultSugar ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (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) 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)))) (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)))) (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: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list)))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier)))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier)))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (block (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (identifier)) right: (binary_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (identifier))))) consequence: (block (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (cast_expression type: (floating_point_type) value: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (identifier))))) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (cast_expression type: (floating_point_type) value: (parenthesized_expression (binary_expression left: (decimal_integer_literal) right: (identifier))))) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (string_literal)) right: (identifier)))))))