public static void main ( String args [ ] ) throws Exception {
  StringTokenizer stok = new StringTokenizer ( new Scanner ( System . in ) . useDelimiter ( "\\A" ) . next ( ) ) ;
  StringBuilder sb = new StringBuilder ( ) ;
  int n = Integer . parseInt ( stok . nextToken ( ) ) ;
  long [ ] t = new long [ n ] , v = new long [ n ] ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) v [ i ] = Long . parseLong ( stok . nextToken ( ) ) ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) t [ i ] = Long . parseLong ( stok . nextToken ( ) ) ;
  long pt = 0 ;
  TreeSet < long [ ] > st = new TreeSet < long [ ] > ( ( x , y ) -> x [ 0 ] == y [ 0 ] ? Long . compare ( x [ 1 ] , y [ 1 ] ) : Long . compare ( x [ 0 ] , y [ 0 ] ) ) ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    st . add ( new long [ ] {
      pt + v [ i ] , i }
      ) ;
      long [ ] ct = new long [ ] {
        pt + t [ i ] , n + 5 };
        long pv = 0 ;
        while ( st . floor ( ct ) != null ) {
          long [ ] vl = st . floor ( ct ) ;
          st . remove ( vl ) ;
          pv += vl [ 0 ] - pt ;
        }
        pv += st . size ( ) * t [ i ] ;
        pt = ct [ 0 ] ;
        sb . append ( pv + " " ) ;
      }
      System . out . println ( sb ) ;
    }
    
public static void main ( String args [ ] ) throws Exception { StringTokenizer stok = new StringTokenizer ( new Scanner ( System . in ) . useDelimiter ( " \\ A " ) . next ( ) ) ; StringBuilder sb = new StringBuilder ( ) ; int n = Integer . parseInt ( stok . nextToken ( ) ) ; long [ ] t = new long [ n ] , v = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) v [ i ] = Long . parseLong ( stok . nextToken ( ) ) ; for ( int i = 0 ; i < n ; i ++ ) t [ i ] = Long . parseLong ( stok . nextToken ( ) ) ; long pt = 0 ; TreeSet < long [ ] > st = new TreeSet < long [ ] > ( ( x , y ) -> x [ 0 ] == y [ 0 ] ? Long . compare ( x [ 1 ] , y [ 1 ] ) : Long . compare ( x [ 0 ] , y [ 0 ] ) ) ; for ( int i = 0 ; i < n ; i ++ ) { st . add ( new long [ ] { pt + v [ i ] , i } ) ; long [ ] ct = new long [ ] { pt + t [ i ] , n + 5 } ; long pv = 0 ; while ( st . floor ( ct ) != null ) { long [ ] vl = st . floor ( ct ) ; st . remove ( vl ) ; pv += vl [ 0 ] - pt ; } pv += st . size ( ) * t [ i ] ; pt = ct [ 0 ] ; sb . append ( pv + " ▁ " ) ; } System . out . println ( sb ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) (throws (type_identifier)) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (method_invocation object: (method_invocation object: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))) name: (identifier) arguments: (argument_list (string_literal))) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_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 (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier)))) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (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: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))))) (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: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (array_type element: (integral_type) dimensions: (dimensions)))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (array_type element: (integral_type) dimensions: (dimensions)))) arguments: (argument_list (lambda_expression parameters: (inferred_parameters (identifier) (identifier)) body: (ternary_expression condition: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal))) consequence: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (decimal_integer_literal)) (array_access array: (identifier) index: (decimal_integer_literal)))) alternative: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (decimal_integer_literal)) (array_access array: (identifier) index: (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 (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_creation_expression type: (integral_type) dimensions: (dimensions) value: (array_initializer (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))) (identifier)))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions) value: (array_initializer (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))) (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (null_literal))) body: (block (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (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: (identifier) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (array_access array: (identifier) index: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (decimal_integer_literal)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (string_literal))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))