func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long MXN = 80 + 10;   const long long MX5 = 4e5 + 10;   const long long MX6 = 1e6 + 10;   const long long LOG = 20;   const long long INF = 8e18;   const double eps = 1e-9;   const long long MOD = 1e9 + 7;   long long power(long long a, long long b, long long md) {     return (!b ? 1                : (b & 1 ? a * power(a * a % md, b / 2, md) % md                         : power(a * a % md, b / 2, md) % md));   }   long long bmm(long long a, long long b) {     return (a % b == 0 ? b : bmm(b, a % b));   }   string base2(long long n) {     string a =   ;     while (n >= 2) {       a += (char)(n % 2 +  0 );       n /= 2;     }     a += (char)(n +  0 );     reverse((a).begin(), (a).end());     return a;   }   long long n;   long long PS[MX5], Ans[MX5], ex[MX5];   vector<long long> second, T;   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> n;     for (int i = 0; i < n; i++) {       long long x;       cin >> x;       second.push_back(x);     }     for (int i = 0; i < n; i++) {       long long x;       cin >> x;       T.push_back(x);     }     PS[0] = T[0];     for (int i = 1; i < n; i++) PS[i] = PS[i - 1] + T[i];     PS[n] = INF;     for (int i = 0; i < n; i++) {       long long men = (i - 1 < 0 ? 0 : PS[i - 1]);       if (second[i] <= T[i]) {         ex[i] += second[i];         continue;       }       long long l = i, r = n;       while (r - l > 1) {         long long mid = (l + r) / 2;         if (PS[mid] - men <= second[i]) {           l = mid;         } else {           r = mid;         }       }       Ans[l + 1]--, Ans[i]++;       if (PS[l] - men < second[i]) {         ex[l + 1] += second[i] - PS[l] + men;       }     }     for (int i = 1; i < n; i++) Ans[i] += Ans[i - 1];     for (int i = 0; i < n; i++) {       cout << Ans[i] * T[i] + ex[i] <<    ;     }     return 0;   }   