public static void process ( ) throws IOException {
  int n = sc . nextInt ( ) ;
  int arr [ ] = sc . readArray ( n ) ;
  int b [ ] = sc . readArray ( n ) ;
  int ff = 0 , ss = 0 ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    if ( arr [ i ] == b [ i ] ) continue ;
    if ( arr [ i ] == 1 ) ff ++ ;
    else ss ++ ;
  }
  if ( ff == 0 ) {
    System . out . println ( - 1 ) ;
    return ;
  }
  ss ++ ;
  int ans = ceil ( ss , ff ) ;
  System . out . println ( ans ) ;
}

public static void process ( ) throws IOException { int n = sc . nextInt ( ) ; int arr [ ] = sc . readArray ( n ) ; int b [ ] = sc . readArray ( n ) ; int ff = 0 , ss = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( arr [ i ] == b [ i ] ) continue ; if ( arr [ i ] == 1 ) ff ++ ; else ss ++ ; } if ( ff == 0 ) { System . out . println ( - 1 ) ; return ; } ss ++ ; int ans = ceil ( ss , ff ) ; System . out . println ( ans ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters) (throws (type_identifier)) body: (block (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) dimensions: (dimensions) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) 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 (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (array_access array: (identifier) index: (identifier)))) consequence: (continue_statement)) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) consequence: (expression_statement (update_expression (identifier))) alternative: (expression_statement (update_expression (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (unary_expression operand: (decimal_integer_literal))))) (return_statement))) (expression_statement (update_expression (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))