#include <bits/stdc++.h>
using namespace std;
struct node {
  node *L, *R;
  long long x, de, sum, y, size;
  node(long long x) : x(x) {
    L = R = 0;
    sum = x;
    de = 0;
    y = rand();
    size = 1;
  }
  void upd(long long t) {
    sum += t * size;
    x += t;
    de += t;
  }
  void push() {
    if (L) L->upd(de);
    if (R) R->upd(de);
    de = 0;
  }
};
typedef node *treap;
int sz(treap t) { return t ? t->size : 0; }
long long sum(treap t) { return t ? t->sum : 0; }
void recalc(treap t) {
  t->sum = t->x + sum(t->L) + sum(t->R);
  t->size = 1 + sz(t->L) + sz(t->R);
}
void merge(treap L, treap R, treap &T) {
  if (!L || !R) {
    T = L ? L : R;
    return;
  }
  L->push();
  R->push();
  if (L->y > R->y)
    T = L, merge(L->R, R, L->R);
  else
    T = R, merge(L, R->L, R->L);
  recalc(T);
}
void split(treap T, treap &L, treap &R, long long k) {
  if (!T) {
    L = R = 0;
    return;
  }
  T->push();
  if (T->x <= k) {
    split(T->R, T->R, R, k);
    L = T;
  } else
    R = T, split(T->L, L, T->L, k);
  recalc(T);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> V(n);
  for (int &x : V) cin >> x;
  treap tr = 0;
  for (int i(0); i < n; ++i) {
    long long ans(0);
    long long T;
    cin >> T;
    treap L, R;
    split(tr, L, R, V[i]);
    merge(L, new node(V[i]), L);
    merge(L, R, tr);
    split(tr, L, tr, T);
    ans += sum(L);
    if (tr) {
      ans += sz(tr) * T;
      tr->upd(-T);
    }
    cout << ans << ' ';
  }
}
