public static void main ( String [ ] args ) throws IOException {
  int n = readInt ( ) , v = readInt ( ) , arr [ ] = new int [ n ] , arr1 [ ] = new int [ n ] , val = 0 ;
  double min = Double . MAX_VALUE ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    arr [ i ] = readInt ( ) ;
    val += arr [ i ] ;
  }
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    arr1 [ i ] = readInt ( ) ;
    min = Math . min ( min , arr1 [ i ] / 1.0 / arr [ i ] ) ;
  }
  for ( double i = min ;
  i >= 0 ;
  i -= 0.00001 ) {
    double cur = i * val ;
    if ( cur <= v ) {
      System . out . println ( cur ) ;
      return ;
    }
  }
}

public static void main ( String [ ] args ) throws IOException { int n = readInt ( ) , v = readInt ( ) , arr [ ] = new int [ n ] , arr1 [ ] = new int [ n ] , val = 0 ; double min = Double . MAX_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { arr [ i ] = readInt ( ) ; val += arr [ i ] ; } for ( int i = 0 ; i < n ; i ++ ) { arr1 [ i ] = readInt ( ) ; min = Math . min ( min , arr1 [ i ] / 1.0 / arr [ i ] ) ; } for ( double i = min ; i >= 0 ; i -= 0.00001 ) { double cur = i * val ; if ( cur <= v ) { System . out . println ( cur ) ; return ; } } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier)))) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier)))) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (floating_point_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: (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: (identifier)) right: (method_invocation name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (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: (identifier)) right: (method_invocation name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_floating_point_literal)) right: (array_access array: (identifier) index: (identifier))))))))) (for_statement init: (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (assignment_expression left: (identifier) right: (decimal_floating_point_literal)) body: (block (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier)))) (return_statement)))))))