#include <bits/stdc++.h>
using namespace std;
template <typename T>
using minpq = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
using maxpq = priority_queue<T, vector<T>, less<T>>;
template <typename T1, typename T2>
struct pair_hash {
  size_t operator()(const pair<T1, T2> &p) const {
    return 31 * hash<T1>{}(p.first) + hash<T2>{}(p.second);
  }
};
template <typename Value, typename Comparator = less<Value>>
struct IncrementalSkewHeap {
 private:
  Comparator cmp;
  struct Node {
    Value val;
    Node *left = nullptr, *right = nullptr;
    Value delta = 0;
    Node(Value val) : val(val) {}
  };
  int sz = 0;
  Node *root = nullptr;
  void propagate(Node *a) {
    a->val += a->delta;
    if (nullptr != a->left) a->left->delta += a->delta;
    if (nullptr != a->right) a->right->delta += a->delta;
    a->delta = 0;
  }
  Node *merge(Node *a, Node *b) {
    if (nullptr == a || nullptr == b) return nullptr == a ? b : a;
    propagate(a);
    propagate(b);
    if (cmp(b->val, a->val)) swap(a, b);
    a->right = merge(b, a->right);
    swap(a->left, a->right);
    return a;
  }

 public:
  IncrementalSkewHeap() {}
  bool isEmpty() { return nullptr == root; }
  Value top() {
    propagate(root);
    return root->val;
  }
  Value pop() {
    propagate(root);
    Value ret = root->val;
    Node *temp = root;
    root = merge(root->left, root->right);
    delete (temp);
    sz--;
    return ret;
  }
  void push(Value val) {
    Node *x = new Node(val);
    root = merge(root, x);
    sz++;
  }
  void increment(Value delta) {
    if (nullptr != root) root->delta += delta;
  }
  void merge(IncrementalSkewHeap &h) {
    root = merge(root, h.root);
    sz += h.sz;
  }
  int size() { return sz; }
};
int N;
long long V[100005], T[100005];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> N;
  IncrementalSkewHeap<long long> heap;
  for (auto i = (0); i < (N); i++) cin >> V[i];
  for (auto i = (0); i < (N); i++) cin >> T[i];
  for (auto i = (0); i < (N); i++) {
    long long sum = 0;
    heap.push(V[i]);
    while (!heap.isEmpty() && heap.top() - T[i] <= 0) {
      sum += heap.pop();
    }
    heap.increment(-T[i]);
    sum += heap.size() * T[i];
    cout << sum << " \n"[i == N - 1];
  }
  return 0;
}
