#include <bits/stdc++.h>   using namespace std;   template <typename Q>   void inin(Q &x) {     x = 0;     int f = 0;     char ch = getchar();     while (ch <  0  || ch >  9 ) {       if (ch ==  - ) f = 1;       ch = getchar();     }     while (ch >=  0  && ch <=  9 ) x = x * 10 + ch -  0 , ch = getchar();     x = f ? -x : x;   }   int n, a[100010], b[100010];   long long sum[100010], ans[100010], tot[100010];   int erfen(int x, int l, int r) {     int ll = l, rr = r, mid;     while (ll < rr) {       mid = (ll + rr) >> 1;       if (sum[mid] - sum[l - 1] < x)         ll = mid + 1;       else         rr = mid;     }     if (ll == n && sum[n] - sum[l - 1] < x) return n + 1;     return ll;   }   int main() {     inin(n);     for (int i = (1); i <= (n); i++) inin(a[i]);     for (int i = (1); i <= (n); i++) inin(b[i]), sum[i] = sum[i - 1] + b[i];     for (int i = (1); i <= (n); i++) {       int x = erfen(a[i], i, n);       tot[x]--;       ans[x] += a[i] - (sum[x - 1] - sum[i - 1]);       tot[i] += tot[i - 1] + 1;       ans[i] += 1LL * b[i] * tot[i];     }     for (int i = (1); i <= (n); i++) printf( %lld  , ans[i]);     return 0;   }   