import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.stream.Stream;

public class Solution implements Runnable {

	static final double time = 1e9;
	static final int MOD = (int) 1e9 + 7;
	static final long mh = Long.MAX_VALUE;
	static final Reader in = new Reader();
	static final PrintWriter out = new PrintWriter(System.out);
	StringBuilder answer = new StringBuilder();

	public static void main(String[] args) {
		new Thread(null, new Solution(), "persefone", 1 << 28).start();
	}

	@Override
	public void run() {
		long start = System.nanoTime();
		solve();
		printf();
		long elapsed = System.nanoTime() - start;
//		out.println("stamp : " + elapsed / time);
//		out.println("stamp : " + TimeUnit.SECONDS.convert(elapsed, TimeUnit.NANOSECONDS));
		close();
	}

	void solve() {
		int n = in.nextInt();
		int[] v = in.nextIntArray(n);
		int[] t = in.nextIntArray(n);
		long[] T = new long[n + 1];
		for (int i = 0; i < n; i++)
			T[i + 1] = T[i] + t[i];
//		printf(T);

		long[] ans = new long[n + 2];
		int[] f = new int[n + 2];

		for (int i = 0; i < n; i++) {
			int l = i + 1, r = n + 1, m = 0, x = n + 1;
			while (l < r) {
				m = l + r >> 1;
			    if (T[m] - T[i] > v[i]) {
			    	r = m;
			    	x = m;
			    } else {
			    	l = m + 1;
			    }
			}

//			printf(i + 1 + " " + x);
			ans[i + 1] += 1;
			ans[x] -= 1;

			if (x <= n) f[x] += v[i] - T[x - 1] + T[i];
//			printf(f[x]);
		}

//		printf(ans);

		for (int i = 1; i <= n; i++) ans[i] += ans[i - 1];
		for (int i = 1; i <= n; i++) {
			ans[i] *= t[i - 1];
			ans[i] += f[i];
		}
		for (int i = 1; i <= n; i++) add(ans[i], ' ');
	}

	int pow(int a, int b, int p) {
		long ans = 1, base = a;
		while (b > 0){
			if ((b & 1) > 0) {
				ans *= base %= p;
			}
			base *= base %= p;
			b >>= 1;
		}
		return (int)ans;
	}

	public static int[] enumLowestPrimeFactors(int n) {
		int tot = 0;
		int[] lpf = new int[n + 1];
		int u = n + 32;
		double lu = Math.log(u);
		int[] primes = new int[(int) (u / lu + u / lu / lu * 1.5)];
		for (int i = 2; i <= n; i++)
			lpf[i] = i;
		for (int p = 2; p <= n; p++) {
			if (lpf[p] == p)
				primes[tot++] = p;
			int tmp;
			for (int i = 0; i < tot && primes[i] <= lpf[p] && (tmp = primes[i] * p) <= n; i++) {
				lpf[tmp] = primes[i];
			}
		}
		return lpf;
	}

	public static int[] enumNumDivisorsFast(int n, int[] lpf)
	{
		int[] nd = new int[n+1];
		nd[1] = 1;
		for(int i = 2;i <= n;i++){
			int j = i, e = 0;
			while(j % lpf[i] == 0){
				j /= lpf[i];
				e++;
			}
			nd[i] = nd[j] * (e+1);
		}
		return nd;
	}

	boolean isPrime(long n) {

		for (int i = 2; 1l * i * i <= n; i++)
			if (n % i == 0)
				return false;
		return true;
	}

	void printf() {
		out.print(answer);
	}

	void close() {
		out.close();
	}

	void printf(Stream<?> str) {
		str.forEach(o -> add(o, " "));
		add("\n");
	}

	void printf(Object... obj) {
		printf(false, obj);
	}

	void printfWithDescription(Object... obj) {
		printf(true, obj);
	}

	private void printf(boolean b, Object... obj) {

		if (obj.length > 1) {
			for (int i = 0; i < obj.length; i++) {
				if (b) add(obj[i].getClass().getSimpleName(), " - ");
				if (obj[i] instanceof Collection<?>) {
					printf((Collection<?>) obj[i]);
				} else if (obj[i] instanceof int[][]) {
					printf((int[][])obj[i]);
				} else if (obj[i] instanceof long[][]) {
					printf((long[][])obj[i]);
				} else if (obj[i] instanceof double[][]) {
					printf((double[][])obj[i]);
				} else printf(obj[i]);
			}
			return;
		}

		if (b) add(obj[0].getClass().getSimpleName(), " - ");
		printf(obj[0]);
	}

	void printf(Object o) {
		if (o instanceof int[])
			printf(Arrays.stream((int[]) o).boxed());
		else if (o instanceof char[])
			printf(new String((char[]) o));
		else if (o instanceof long[])
			printf(Arrays.stream((long[]) o).boxed());
		else if (o instanceof double[])
			printf(Arrays.stream((double[]) o).boxed());
		else if (o instanceof boolean[]) {
			for (boolean b : (boolean[]) o) add(b, " ");
			add("\n");
		}
		else
			add(o, "\n");
	}

	void printf(int[]... obj) {
		for (int i = 0; i < obj.length; i++) printf(obj[i]);
	}

	void printf(long[]... obj) {
		for (int i = 0; i < obj.length; i++) printf(obj[i]);
	}

	void printf(double[]... obj) {
		for (int i = 0; i < obj.length; i++) printf(obj[i]);
	}

	void printf(boolean[]... obj) {
		for (int i = 0; i < obj.length; i++) printf(obj[i]);
	}

	void printf(Collection<?> col) {
		printf(col.stream());
	}

	<T, K> void add(T t, K k) {
		if (t instanceof Collection<?>) {
			((Collection<?>) t).forEach(i -> add(i, " "));
		} else if (t instanceof Object[]) {
			Arrays.stream((Object[]) t).forEach(i -> add(i, " "));
		} else
			add(t);
		add(k);
	}

	<T> void add(T t) {
		answer.append(t);
	}

	@SuppressWarnings("unchecked")
	<T extends Comparable<? super T>> T min(T... t) {
		if (t.length == 0)
			return null;
		T m = t[0];
		for (int i = 1; i < t.length; i++)
			if (t[i].compareTo(m) < 0)
				m = t[i];
		return m;
	}

	@SuppressWarnings("unchecked")
	<T extends Comparable<? super T>> T max(T... t) {
		if (t.length == 0)
			return null;
		T m = t[0];
		for (int i = 1; i < t.length; i++)
			if (t[i].compareTo(m) > 0)
				m = t[i];
		return m;
	}

	int gcd(int a, int b) {
		return (b == 0) ? a : gcd(b, a % b);
	}

	long gcd(long a, long b) {
		return (b == 0) ? a : gcd(b, a % b);
	}

	long lcm(int a, int b) {
		return (1l * a * b / gcd(a, b));
	}

	long lcm(long a, long b) {
		if (a > Long.MAX_VALUE / b) throw new RuntimeException();
		return a * b / gcd(a, b);
	}

	// c = gcd(a, b) -> extends gcd method: ax + by = c <----> (b % a)p + q = c;
	int[] ext_gcd(int a, int b) {
		if (b == 0) return new int[] {a, 1, 0 };
		int[] vals = ext_gcd(b, a % b);
		int d = vals[0]; // gcd
	    int p = vals[2]; //
		int q = vals[1] - (a / b) * vals[2];
		return new int[] { d, p, q };
	}

	// find any solution of the equation: ax + by = c using extends gcd
	boolean find_any_solution(int a, int b, int c, int[] root) {
		int[] vals = ext_gcd(Math.abs(a), Math.abs(b));
		if (c % vals[0] != 0) return false;
		printf(vals);
		root[0] = c * vals[1] / vals[0];
		root[1] = c * vals[2] / vals[0];
		if (a < 0) root[0] *= -1;
		if (b < 0) root[1] *= -1;
		return true;
	}

	int mod(int x) { return x % MOD; }

	int mod(int x, int y) { return mod(mod(x) + mod(y)); }

	long mod(long x) { return x % MOD; }

	long mod (long x, long y) { return mod(mod(x) + mod(y)); }

	int lw(long[] f, int l, int r, long k) {
		int R = r, m = 0;
		while (l <= r) {
			m = l + r >> 1;
		    if (m == R) return m;
		    if (f[m] >= k) r = m - 1; else l = m + 1;
		}
		return l;
	}

	int up(long[] f, int l, int r, long k) {
		int R = r, m = 0;
		while (l <= r) {
			m = l + r >> 1;
		    if (m == R) return m;
		    if (f[m] > k) r = m - 1; else l = m + 1;
		}
		return l;
	}

	int lw(int[] f, int l, int r, int k) {
		int R = r, m = 0;
		while (l <= r) {
			m = l + r >> 1;
		    if (m == R) return m;
		    if (f[m] >= k) r = m - 1; else l = m + 1;
		}
		return l;
	}

	int up(int[] f, int l, int r, int k) {
		int R = r, m = 0;
		while (l <= r) {
			m = l + r >> 1;
		    if (m == R) return m;
		    if (f[m] > k) r = m - 1; else l = m + 1;
		}
		return l;
	}

	<K extends Comparable<K>> int lw(List<K> li, int l, int r, K k) {
		int R = r, m = 0;
		while (l <= r) {
			m = l + r >> 1;
		    if (m == R) return m;
		    if (li.get(m).compareTo(k) >= 0)
		    	r = m - 1;
		    else
		    	l = m + 1;
		}
		return l;
	}

	<K extends Comparable<K>> int up(List<K> li, int l, int r, K k) {
		int R = r, m = 0;
		while (l <= r) {
			m = l + r >> 1;
		    if (m == R) return m;
		    if (li.get(m).compareTo(k) > 0)
		    	r = m - 1;
		    else
		    	l = m + 1;
		}
		return l;
	}

	<K extends Comparable<K>> int bs(List<K> li, int l, int r, K k) {
		while (l <= r) {
			int m = l + r >> 1;
		    if (li.get(m) == k) return m;
		    else if (li.get(m).compareTo(k) < 0)
		    	l = m + 1;
		    else
		    	r = m - 1;
		}
		return -1;
	}

	long calc(int base, int exponent, int p) {
		if (exponent == 0) return 1;
		if (exponent == 1) return base % p;
		long m = calc(base, exponent >> 1, p);
		if (exponent % 2 == 0) return (m * m) % p;
		return 1l * base * m  % p * m % p;
	}

	long calc(int base, long exponent, int p) {
		if (exponent == 0) return 1;
		if (exponent == 1) return base % p;
		long m = calc(base, exponent >> 1, p);
		if (exponent % 2 == 0) return (m * m) % p;
		return 1l * base * m  % p * m % p;
	}

	long calc(long base, long exponent, int p) {
		if (exponent == 0) return 1;
		if (exponent == 1) return base % p;
		long m = calc(base, exponent >> 1, p);
		if (exponent % 2 == 0) return (m * m) % p;
		return base * m  % p * m % p;
	}

	long power(int base, int exponent) {
		if (exponent == 0) return 1;
		long m = power(base, exponent / 2);
		if (exponent % 2 == 0) return m * m;
		return base * m * m;
	}

	void swap(int[] a, int i, int j) {
		a[i] ^= a[j];
		a[j] ^= a[i];
		a[i] ^= a[j];
	}

	void swap(long[] a, int i, int j) {
		long tmp = a[i];
		a[i] = a[j];
		a[j] = tmp;
	}

	static class Pair<K extends Comparable<? super K>, V extends Comparable<? super V>>
			implements Comparable<Pair<K, V>> {
		private K k;
		private V v;

		Pair() {}

		Pair(K k, V v) {
			this.k = k;
			this.v = v;
		}

		K getK() { return k; }

		V getV() { return v; }

		void setK(K k) { this.k = k; }

		void setV(V v) { this.v = v; }

		void setKV(K k, V v) {
			this.k = k;
			this.v = v;
		}

		@SuppressWarnings("unchecked")
		@Override
		public boolean equals(Object o) {
			if (this == o) return true;
			if (o == null || !(o instanceof Pair)) return false;
			Pair<K, V> p = (Pair<K, V>) o;
			return k.compareTo(p.k) == 0 && v.compareTo(p.v) == 0;
		}

		@Override
		public int hashCode() {
			int hash = 31;
			hash = hash * 89 + k.hashCode();
			hash = hash * 89 + v.hashCode();
			return hash;
		}

		@Override
		public int compareTo(Pair<K, V> pair) {
			return k.compareTo(pair.k) == 0 ? v.compareTo(pair.v) : k.compareTo(pair.k);
		}

		@Override
		public Pair<K, V> clone() {
			return new Pair<K, V>(this.k, this.v);
		}

		@Override
		public String toString() {
			return String.valueOf(k).concat(" ").concat(String.valueOf(v)).concat("\n");
		}
	}

	static class Reader {
		private BufferedReader br;
		private StringTokenizer st;

		Reader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			try {
				while (st == null || !st.hasMoreTokens()) {
					st = new StringTokenizer(br.readLine());
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		int[] nextIntArray(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++)
				arr[i] = nextInt();
			return arr;
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		String nextLine() {
			String s = "";
			try {
				s = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return s;
		}
	}
}


import java.io.*;
import java.util.*;

import static java.lang.Math.*;

public class Main {
    BufferedReader br;
    StringTokenizer in;
    PrintWriter pw;
    Random r;
    int INF = (int) 1e9;
    long LNF = (long) 1e18;
    long mod = (long) (1e9 + 7);
    int pp = 27;
    // you shall not hack!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    //        /*\
    //       ///          /^\
    //      ///    ~~~~  (___)
    //     ///   ~~~~~~~~  \\__
    //   _/_/_  ~/ .& . \~  \\ \
    //  [____] ~|  (__)  |~/ \\/
    //  /_/\  \~|~~~~~~~~~~  /\\
    //      \   ~~~~~~~~~~ _/ \\
    //       \ _    ~~   _/\   \\
    //      /  |        /   \   \\
    //     |  /        |     \   \\
    //    /  /   ___   |      \
    //   /___|  | __|  |_______\
    //      _|  |   |  |_
    //     |____|   |____|
    //       P.S this is omnipotent Gandalf

    int n;
    ArrayList<Integer>[] g;
    int u[];
    boolean used[];

    void solve() throws IOException {
        int n = nextInt();
        TreeSet<Long> vv = new TreeSet<>();
        int V[] = new int[n];
        for (int i = 0; i < n; i++) {
            V[i] = nextInt();
        }
        int T[] = new int[n];
        for (int i = 0; i < n; i++) {
            T[i] = nextInt();
        }
        long sumt = 0;
        for (int i = 0; i < n; i++) {
            int ans = 0;
            long v = V[i];
            v += sumt;
            vv.add(v);
            int t = T[i];
            sumt += t;
            while (vv.size() > 0 && vv.first() <= sumt) {
                ans += vv.pollFirst() - (sumt - t);
            }
            ans += vv.size() * t;
            pw.print(ans + " ");
        }
    }

    class event implements Comparable<event> {
        int time;
        int t;
        int a;

        public event(int ttime, int tt, int aa) {
            time = ttime;
            t = tt;
            a = aa;
        }

        @Override
        public int compareTo(event o) {
            if (time != o.time) return time - o.time;
            return o.t - t;
        }
    }

    //***************************************
    class road {
        int to;

        int w;

        public road(int tto, int ww) {
            to = tto;
            w = ww;
        }
    }

    class pair {
        int a;

        int b;

        public pair(int aa, int bb) {
            a = aa;
            b = bb;
        }

    }

    Comparator<pair> bya = new Comparator<pair>() {
        @Override
        public int compare(pair o1, pair o2) {
            if (o1.a != o2.a) return Integer.compare(o1.a, o2.a);
            return Integer.compare(o1.b, o2.b);
        }
    };
    Comparator<pair> byb = new Comparator<pair>() {
        @Override
        public int compare(pair o1, pair o2) {
            if (o1.b != o2.b) return Integer.compare(o1.b, o2.b);
            return Integer.compare(o1.a, o2.a);
        }
    };
    Comparator<road> byw = new Comparator<road>() {
        @Override
        public int compare(road o1, road o2) {
            if (o1.w != o2.w) return Integer.compare(o1.w, o2.w);
            return Integer.compare(o1.to, o2.to);
        }
    };
    Comparator<road> byto = new Comparator<road>() {
        @Override
        public int compare(road o1, road o2) {
            return Integer.compare(o1.to, o2.to);
        }
    };

    class node {
        int sz;
        int val;
        //        long sum;
        node L;
        node R;
        int prior;

        public node(int val) {
            this.val = val;
            prior = r.nextInt();
            L = null;
            R = null;
            sz = 1;
//            sum = (long)val * val;
        }

        void add(int z) {
            val = val + z;
//            sum = (long)val * val;
        }
    }

    void relax(node c) {
        if (c == null) return;
        c.sz = sfsz(c.L) + sfsz(c.R) + 1;
//        c.sum = sfsum(c.L) + sfsum(c.R) + c.val * c.val;
    }

    int sfsz(node c) {
        if (c == null) return 0;
        return c.sz;
    }

    node merge(node a, node b) {
        if (a == null) return b;
        if (b == null) return a;
        if (a.prior > b.prior) {
            a.R = merge(a.R, b);
            relax(a);
            return a;
        } else {
            b.L = merge(a, b.L);
            relax(b);
            return b;
        }
    }

    pairn split(node c, int s) {
        if (c == null) return new pairn(null, null);
        if (sfsz(c.L) >= s) {
            pairn p = split(c.L, s);
            c.L = p.b;
            relax(c);
//            relax(p.a);
            return new pairn(p.a, c);
        } else {
            pairn p = split(c.R, s - sfsz(c.L) - 1);
            c.R = p.a;
            relax(c);
//            relax(p.b);
            return new pairn(c, p.b);
        }
    }

    class pairn {
        node a;
        node b;

        public pairn(node a, node b) {
            this.a = a;
            this.b = b;
        }

    }

    String nextToken() throws IOException {
        while (in == null || !in.hasMoreTokens()) {
            in = new StringTokenizer(br.readLine());
        }
        return in.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    void gener() throws IOException {
        pw = new PrintWriter(new FileWriter("input.txt"));

        pw.close();
    }

    public void run() throws IOException {
        r = new Random(5);
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new OutputStreamWriter(System.out));
//        br = new BufferedReader(new FileReader("input.txt"));
//        pw = new PrintWriter(new FileWriter("output.txt"));
//        br = new BufferedReader(new FileReader("holidays.in"));
//        pw = new PrintWriter(new FileWriter("holidays.out"));
        solve();
        pw.close();
    }

    public static void main(String[] args) throws IOException {
        new Main().run();
    }
}


import java.io.*;
import java.util.*;

import static java.lang.Math.*;

public class Main {
    BufferedReader br;
    StringTokenizer in;
    PrintWriter pw;
    Random r;
    int INF = (int) 1e9;
    long LNF = (long) 1e18;
    long mod = (long) (1e9 + 7);
    int pp = 27;
    // you shall not hack!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    //        /*\
    //       ///          /^\
    //      ///    ~~~~  (___)
    //     ///   ~~~~~~~~  \\__
    //   _/_/_  ~/ .& . \~  \\ \
    //  [____] ~|  (__)  |~/ \\/
    //  /_/\  \~|~~~~~~~~~~  /\\
    //      \   ~~~~~~~~~~ _/ \\
    //       \ _    ~~   _/\   \\
    //      /  |        /   \   \\
    //     |  /        |     \   \\
    //    /  /   ___   |      \
    //   /___|  | __|  |_______\
    //      _|  |   |  |_
    //     |____|   |____|
    //       P.S this is omnipotent Gandalf

    void solve() throws IOException {
        int n = nextInt();
        TreeSet<pair> vv = new TreeSet<>();
        long V[] = new long[n];
        for (int i = 0; i < n; i++) {
            V[i] = nextInt();
        }
        long T[] = new long[n];
        for (int i = 0; i < n; i++) {
            T[i] = nextInt();
        }
        long sumt = 0;
        for (int i = 0; i < n; i++) {
            long ans = 0;
            long v = V[i];
            v += sumt;
            vv.add(new pair( i, v));
            long t = T[i];
            sumt += t;
            while (vv.size() > 0 && vv.first().b <= sumt) {
                ans += vv.pollFirst().b - (sumt - t);
            }
            ans += (long)vv.size() * t;
            pw.print(ans + " ");
        }
    }

    class event implements Comparable<event> {
        int time;
        int t;
        int a;

        public event(int ttime, int tt, int aa) {
            time = ttime;
            t = tt;
            a = aa;
        }

        @Override
        public int compareTo(event o) {
            if (time != o.time) return time - o.time;
            return o.t - t;
        }
    }

    //***************************************
    class road {
        int to;

        int w;

        public road(int tto, int ww) {
            to = tto;
            w = ww;
        }
    }

    class pair implements Comparable<pair>{
        int a;

        long b;

        public pair(int aa, long bb) {
            a = aa;
            b = bb;
        }

        @Override
        public int compareTo(pair o) {
            if (b != o.b) return Long.compare(b, o.b);
            return a - o.a;
        }
    }

    Comparator<road> byw = new Comparator<road>() {
        @Override
        public int compare(road o1, road o2) {
            if (o1.w != o2.w) return Integer.compare(o1.w, o2.w);
            return Integer.compare(o1.to, o2.to);
        }
    };
    Comparator<road> byto = new Comparator<road>() {
        @Override
        public int compare(road o1, road o2) {
            return Integer.compare(o1.to, o2.to);
        }
    };

    class node {
        int sz;
        int val;
        //        long sum;
        node L;
        node R;
        int prior;

        public node(int val) {
            this.val = val;
            prior = r.nextInt();
            L = null;
            R = null;
            sz = 1;
//            sum = (long)val * val;
        }

        void add(int z) {
            val = val + z;
//            sum = (long)val * val;
        }
    }

    void relax(node c) {
        if (c == null) return;
        c.sz = sfsz(c.L) + sfsz(c.R) + 1;
//        c.sum = sfsum(c.L) + sfsum(c.R) + c.val * c.val;
    }

    int sfsz(node c) {
        if (c == null) return 0;
        return c.sz;
    }

    node merge(node a, node b) {
        if (a == null) return b;
        if (b == null) return a;
        if (a.prior > b.prior) {
            a.R = merge(a.R, b);
            relax(a);
            return a;
        } else {
            b.L = merge(a, b.L);
            relax(b);
            return b;
        }
    }

    pairn split(node c, int s) {
        if (c == null) return new pairn(null, null);
        if (sfsz(c.L) >= s) {
            pairn p = split(c.L, s);
            c.L = p.b;
            relax(c);
//            relax(p.a);
            return new pairn(p.a, c);
        } else {
            pairn p = split(c.R, s - sfsz(c.L) - 1);
            c.R = p.a;
            relax(c);
//            relax(p.b);
            return new pairn(c, p.b);
        }
    }

    class pairn {
        node a;
        node b;

        public pairn(node a, node b) {
            this.a = a;
            this.b = b;
        }

    }

    String nextToken() throws IOException {
        while (in == null || !in.hasMoreTokens()) {
            in = new StringTokenizer(br.readLine());
        }
        return in.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    void gener() throws IOException {
        pw = new PrintWriter(new FileWriter("input.txt"));

        pw.close();
    }

    public void run() throws IOException {
        r = new Random(5);
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new OutputStreamWriter(System.out));
//        br = new BufferedReader(new FileReader("input.txt"));
//        pw = new PrintWriter(new FileWriter("output.txt"));
//        br = new BufferedReader(new FileReader("holidays.in"));
//        pw = new PrintWriter(new FileWriter("holidays.out"));
        solve();
        pw.close();
    }

    public static void main(String[] args) throws IOException {
        new Main().run();
    }
}


import java.io.*;
import java.util.*;

import static java.lang.Math.*;

public class Main {
    BufferedReader br;
    StringTokenizer in;
    PrintWriter pw;
    Random r;
    int INF = (int) 1e9;
    long LNF = (long) 1e18;
    long mod = (long) (1e9 + 7);
    int pp = 27;
    // you shall not hack!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    //        /*\
    //       ///          /^\
    //      ///    ~~~~  (___)
    //     ///   ~~~~~~~~  \\__
    //   _/_/_  ~/ .& . \~  \\ \
    //  [____] ~|  (__)  |~/ \\/
    //  /_/\  \~|~~~~~~~~~~  /\\
    //      \   ~~~~~~~~~~ _/ \\
    //       \ _    ~~   _/\   \\
    //      /  |        /   \   \\
    //     |  /        |     \   \\
    //    /  /   ___   |      \
    //   /___|  | __|  |_______\
    //      _|  |   |  |_
    //     |____|   |____|
    //       P.S this is omnipotent Gandalf

    int n;
    ArrayList<Integer>[] g;
    int u[];
    boolean used[];

    void solve() throws IOException {
        int n = nextInt();
        TreeSet<Long> vv = new TreeSet<>();
        long V[] = new long[n];
        for (int i = 0; i < n; i++) {
            V[i] = nextInt();
        }
        long T[] = new long[n];
        for (int i = 0; i < n; i++) {
            T[i] = nextInt();
        }
        long sumt = 0;
        for (int i = 0; i < n; i++) {
            long ans = 0;
            long v = V[i];
            v += sumt;
            vv.add(v);
            long t = T[i];
            sumt += t;
            while (vv.size() > 0 && vv.first() <= sumt) {
                ans += vv.pollFirst() - (sumt - t);
            }
            ans += vv.size() * t;
            pw.print(ans + " ");
        }
    }

    class event implements Comparable<event> {
        int time;
        int t;
        int a;

        public event(int ttime, int tt, int aa) {
            time = ttime;
            t = tt;
            a = aa;
        }

        @Override
        public int compareTo(event o) {
            if (time != o.time) return time - o.time;
            return o.t - t;
        }
    }

    //***************************************
    class road {
        int to;

        int w;

        public road(int tto, int ww) {
            to = tto;
            w = ww;
        }
    }

    class pair {
        int a;

        int b;

        public pair(int aa, int bb) {
            a = aa;
            b = bb;
        }

    }

    Comparator<pair> bya = new Comparator<pair>() {
        @Override
        public int compare(pair o1, pair o2) {
            if (o1.a != o2.a) return Integer.compare(o1.a, o2.a);
            return Integer.compare(o1.b, o2.b);
        }
    };
    Comparator<pair> byb = new Comparator<pair>() {
        @Override
        public int compare(pair o1, pair o2) {
            if (o1.b != o2.b) return Integer.compare(o1.b, o2.b);
            return Integer.compare(o1.a, o2.a);
        }
    };
    Comparator<road> byw = new Comparator<road>() {
        @Override
        public int compare(road o1, road o2) {
            if (o1.w != o2.w) return Integer.compare(o1.w, o2.w);
            return Integer.compare(o1.to, o2.to);
        }
    };
    Comparator<road> byto = new Comparator<road>() {
        @Override
        public int compare(road o1, road o2) {
            return Integer.compare(o1.to, o2.to);
        }
    };

    class node {
        int sz;
        int val;
        //        long sum;
        node L;
        node R;
        int prior;

        public node(int val) {
            this.val = val;
            prior = r.nextInt();
            L = null;
            R = null;
            sz = 1;
//            sum = (long)val * val;
        }

        void add(int z) {
            val = val + z;
//            sum = (long)val * val;
        }
    }

    void relax(node c) {
        if (c == null) return;
        c.sz = sfsz(c.L) + sfsz(c.R) + 1;
//        c.sum = sfsum(c.L) + sfsum(c.R) + c.val * c.val;
    }

    int sfsz(node c) {
        if (c == null) return 0;
        return c.sz;
    }

    node merge(node a, node b) {
        if (a == null) return b;
        if (b == null) return a;
        if (a.prior > b.prior) {
            a.R = merge(a.R, b);
            relax(a);
            return a;
        } else {
            b.L = merge(a, b.L);
            relax(b);
            return b;
        }
    }

    pairn split(node c, int s) {
        if (c == null) return new pairn(null, null);
        if (sfsz(c.L) >= s) {
            pairn p = split(c.L, s);
            c.L = p.b;
            relax(c);
//            relax(p.a);
            return new pairn(p.a, c);
        } else {
            pairn p = split(c.R, s - sfsz(c.L) - 1);
            c.R = p.a;
            relax(c);
//            relax(p.b);
            return new pairn(c, p.b);
        }
    }

    class pairn {
        node a;
        node b;

        public pairn(node a, node b) {
            this.a = a;
            this.b = b;
        }

    }

    String nextToken() throws IOException {
        while (in == null || !in.hasMoreTokens()) {
            in = new StringTokenizer(br.readLine());
        }
        return in.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    void gener() throws IOException {
        pw = new PrintWriter(new FileWriter("input.txt"));

        pw.close();
    }

    public void run() throws IOException {
        r = new Random(5);
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new OutputStreamWriter(System.out));
//        br = new BufferedReader(new FileReader("input.txt"));
//        pw = new PrintWriter(new FileWriter("output.txt"));
//        br = new BufferedReader(new FileReader("holidays.in"));
//        pw = new PrintWriter(new FileWriter("holidays.out"));
        solve();
        pw.close();
    }

    public static void main(String[] args) throws IOException {
        new Main().run();
    }
}


import java.util.*;
import java.io.*;

public class Main {
    static InReader in;
    static OutWriter out;
    static long ans[];
    static long v[];
    static long sum[];
    static long t[];
    static int breaks[];

    public static void main(String args[]) throws IOException {
        in = new InReader();
        out = new OutWriter();
        int n = in.nextInt();
        ans = new long[n + 1];
        v = new long[n];
        t = new long[n];
        sum = new long[n + 1];
        breaks = new int[n + 1];
        for (int i = 0; i < n; i++) {
            v[i] = in.nextInt();
        }
        for (int i = 0; i < n; i++) {
            t[i] = in.nextInt();
        }
        sum[0] = 0;
        for (int i = 1; i < n + 1; i++) {
            sum[i] = sum[i - 1] + t[i - 1];
        }
        for (int i = 0; i < n; i++) {
            int l = i;
            int r = n;
            int m = 0;
            while (l < r) {
                m = (l + r) / 2;
                if (sum[m + 1] - sum[i] > v[i]) {
                    r = m;
                } else {
                    l = m + 1;
                }
            }
            v[i] -= (sum[r ] - sum[i]);
            ans[r] += v[i];
            breaks[i]++;
            breaks[r]--;

        }
        long curr = 0;
        for (int i = 0; i < n; i++) {
            curr += breaks[i];

            ans[i] += curr * t[i];
            out.prints(ans[i]);
        }
        out.close();

    }
}

class InReader {
    BufferedReader in;

    InReader(String name) throws IOException {
        in = new BufferedReader(new FileReader(name));
    }

    InReader() {
        in = new BufferedReader(new InputStreamReader(System.in));
    }

    StringTokenizer token = new StringTokenizer("");

    void update() throws IOException {
        if (!token.hasMoreTokens()) {
            String a = in.readLine();
            if (a != null) {
                token = new StringTokenizer(a);
            }
        }
    }

    int nextInt() throws IOException {
        update();
        return Integer.parseInt(token.nextToken());
    }

    long nextLong() throws IOException {
        update();
        return Long.parseLong(token.nextToken());
    }

    double nextDouble() throws IOException {
        update();
        return Double.parseDouble(token.nextToken());
    }

    boolean hasNext() throws IOException {
        update();
        return token.hasMoreTokens();
    }

    String next() throws IOException {
        update();
        return token.nextToken();
    }
}

class OutWriter {
    PrintWriter out;

    OutWriter() {
        out = new PrintWriter(System.out);
    }

    OutWriter(String name) throws IOException {
        out = new PrintWriter(new FileWriter(name));
    }

    StringBuilder cout = new StringBuilder();

    <T> void print(T a) {
        cout.append(a);
    }

    <T> void println(T a) {
        cout.append(a);
        cout.append('\n');
    }

    <T> void prints(T a) {
        cout.append(a);
        cout.append(' ');
    }

    void close() {
        out.print(cout.toString());
        out.close();
    }
}


import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class Main {

    public static int[] pref_f(String s) {
        int n = s.length();
        int[] pf = new int[n];
        for(int i = 1; i < n; i++){
            int j = pf[i-1];
            while (j > 0 && s.charAt(i) != s.charAt(j)){
                j = pf[j-1];
            }
            if (s.charAt(i) == s.charAt(j)) j++;
            pf[i] = j;
        }
        return pf;
    }

    public static void shortestPaths(List<Edge>[] edges, int s, int[] d, int[] pred) {
        Arrays.fill(pred, -1);
        Arrays.fill(d, Integer.MAX_VALUE);
        d[s] = 0;
        PriorityQueue<Long> q = new PriorityQueue<>();
        q.add((long) s);
        while (!q.isEmpty()) {
            long cur = q.remove();
            int curu = (int) cur;
            if (cur >>> 32 != d[curu])
                continue;
            for (Edge e : edges[curu]) {
                int v = e.t;
                int nprio = d[curu] + e.cost;
                if (d[v] > nprio) {
                    d[v] = nprio;
                    pred[v] = curu;
                    q.add(((long) nprio << 32) + v);
                }
            }
        }
    }

    public static class Edge {
        int t;
        int cost;

        public Edge(int t, int cost) {
            this.t = t;
            this.cost = cost;
        }
    }

    public static void main(String[] args) throws IOException {
        FastScanner in = new FastScanner(System.in);
        FastPrinter out = new FastPrinter(System.out);
        //FastScanner in = new FastScanner(new InputStreamReader(new FileInputStream(new File("strings.in"))));
        //FastPrinter out = new FastPrinter(new OutputStreamWriter(new FileOutputStream(new File("strings.out"))));
        int n = in.nextInt();

        int[] masN = new int[n];
        int[] masT = new int[n];
        HashMap<Long, Integer> map = new HashMap<>();

        for(int i = 0; i < n; i++){
            masN[i] = in.nextInt();
        }

        for(int i = 0; i < n; i++){
            masT[i] = in.nextInt();
        }

        long tCount = 0;
        TreeSet<Long> set = new TreeSet<>();

        long ans = 0;
        long kAns = 0;

        for(int i = 0; i < n; i++){
            ans = 0;
            long k = masN[i] + tCount;
            set.add(k);
            kAns++;

            long count = set.first();
            map.put(k, map.get(k) == null ? 1 : map.get(k) + 1);

            tCount += masT[i];
            while (count <= tCount) {
                kAns--;
                ans += masT[i] - (tCount - set.first());
                if(map.get(count) > 0) map.put(count, map.get(count) - 1);
                if(map.get(count) == 0) set.remove(count);
                if(set.isEmpty()) break;
                count = set.first();
            }
            ans += kAns * masT[i];
            System.out.print(ans + " ");
        }

        out.close();
    }
}

class FastPrinter {
    private final PrintWriter writer;

    public FastPrinter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public FastPrinter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void close() {
        writer.close();
    }

    public void println(long i) {
        writer.println(i);
    }

    public void println(double d) {
        writer.println(d);
    }

    public void println(String s) {
        writer.println(s);
    }

    public void println(String format, Object... args) {
        println(String.format(format, args));
    }

    public void println() {
        writer.println();
    }

    public void print(long i) {
        writer.print(i);
    }

    public void print(char c) {
        writer.print(c);
    }

    public void print(double d) {
        writer.print(d);
    }

    public void print(String s) {
        writer.print(s);
    }

    public void print(String format, Object... args) {
        print(String.format(format, args));
    }

    public void flush() {
        writer.flush();
    }
}

class FastScanner {

    private BufferedReader reader;
    private StringTokenizer st;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public FastScanner(InputStream stream) {
        this.reader = new BufferedReader(new InputStreamReader(stream));
        this.st = new StringTokenizer("");
    }

    public FastScanner(InputStreamReader stream) {
        this.reader = new BufferedReader(stream);
        this.st = new StringTokenizer("");
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }

    public String next() {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(readLine());
        }
        return st.nextToken();
    }

    public String nextLine() {
        st = new StringTokenizer("");
        return readLine();
    }

    public String tryNextLine() {
        st = new StringTokenizer("");
        return tryReadLine();
    }

    private String readLine() {
        String line = tryReadLine();
        if (line == null) throw new InputMismatchException();
        return line;
    }

    private String tryReadLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    public int[] nextIntArray(int size) {
        int[] array = new int[size];
        for (int i = 0; i < size; i++)
            array[i] = nextInt();
        return array;
    }

    public int[][] nextIntTable(int rowCount, int columnCount) {
        int[][] table = new int[rowCount][];
        for (int i = 0; i < rowCount; i++)
            table[i] = nextIntArray(columnCount);
        return table;
    }

    public long[] nextLongArray(int size) {
        long[] array = new long[size];
        for (int i = 0; i < size; i++)
            array[i] = nextLong();
        return array;
    }

    public long[][] nextLongTable(int rowCount, int columnCount) {
        long[][] table = new long[rowCount][];
        for (int i = 0; i < rowCount; i++)
            table[i] = nextLongArray(columnCount);
        return table;
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\t' || isEOL(c);
    }

    public static boolean isEOL(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}


import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class Main {

    public static int[] pref_f(String s) {
        int n = s.length();
        int[] pf = new int[n];
        for(int i = 1; i < n; i++){
            int j = pf[i-1];
            while (j > 0 && s.charAt(i) != s.charAt(j)){
                j = pf[j-1];
            }
            if (s.charAt(i) == s.charAt(j)) j++;
            pf[i] = j;
        }
        return pf;
    }

    public static void shortestPaths(List<Edge>[] edges, int s, int[] d, int[] pred) {
        Arrays.fill(pred, -1);
        Arrays.fill(d, Integer.MAX_VALUE);
        d[s] = 0;
        PriorityQueue<Long> q = new PriorityQueue<>();
        q.add((long) s);
        while (!q.isEmpty()) {
            long cur = q.remove();
            int curu = (int) cur;
            if (cur >>> 32 != d[curu])
                continue;
            for (Edge e : edges[curu]) {
                int v = e.t;
                int nprio = d[curu] + e.cost;
                if (d[v] > nprio) {
                    d[v] = nprio;
                    pred[v] = curu;
                    q.add(((long) nprio << 32) + v);
                }
            }
        }
    }

    public static class Edge {
        int t;
        int cost;

        public Edge(int t, int cost) {
            this.t = t;
            this.cost = cost;
        }
    }

    public static void main(String[] args) throws IOException {
        FastScanner in = new FastScanner(System.in);
        FastPrinter out = new FastPrinter(System.out);
        //FastScanner in = new FastScanner(new InputStreamReader(new FileInputStream(new File("strings.in"))));
        //FastPrinter out = new FastPrinter(new OutputStreamWriter(new FileOutputStream(new File("strings.out"))));
        int n = in.nextInt();

        int[] masN = new int[n];
        int[] masT = new int[n];

        for(int i = 0; i < n; i++){
            masN[i] = in.nextInt();
        }

        for(int i = 0; i < n; i++){
            masT[i] = in.nextInt();
        }

        long tCount = 0;
        TreeSet<Long> set = new TreeSet<>();

        int ans = 0;
        int kAns = 0;

        for(int i = 0; i < n; i++){
            ans = 0;
            long k = masN[i] + tCount;
            set.add(k);
            kAns++;

            long count = set.first();

            tCount += masT[i];
            while (count <= tCount) {
                kAns--;
                ans += masT[i] - (tCount - set.first());
                set.remove(set.first());
                if(set.isEmpty()) break;
                count = set.first();
            }
            ans += kAns * masT[i];
            System.out.print(ans + " ");
        }

        out.close();
    }
}

class FastPrinter {
    private final PrintWriter writer;

    public FastPrinter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public FastPrinter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void close() {
        writer.close();
    }

    public void println(long i) {
        writer.println(i);
    }

    public void println(double d) {
        writer.println(d);
    }

    public void println(String s) {
        writer.println(s);
    }

    public void println(String format, Object... args) {
        println(String.format(format, args));
    }

    public void println() {
        writer.println();
    }

    public void print(long i) {
        writer.print(i);
    }

    public void print(char c) {
        writer.print(c);
    }

    public void print(double d) {
        writer.print(d);
    }

    public void print(String s) {
        writer.print(s);
    }

    public void print(String format, Object... args) {
        print(String.format(format, args));
    }

    public void flush() {
        writer.flush();
    }
}

class FastScanner {

    private BufferedReader reader;
    private StringTokenizer st;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public FastScanner(InputStream stream) {
        this.reader = new BufferedReader(new InputStreamReader(stream));
        this.st = new StringTokenizer("");
    }

    public FastScanner(InputStreamReader stream) {
        this.reader = new BufferedReader(stream);
        this.st = new StringTokenizer("");
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }

    public String next() {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(readLine());
        }
        return st.nextToken();
    }

    public String nextLine() {
        st = new StringTokenizer("");
        return readLine();
    }

    public String tryNextLine() {
        st = new StringTokenizer("");
        return tryReadLine();
    }

    private String readLine() {
        String line = tryReadLine();
        if (line == null) throw new InputMismatchException();
        return line;
    }

    private String tryReadLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    public int[] nextIntArray(int size) {
        int[] array = new int[size];
        for (int i = 0; i < size; i++)
            array[i] = nextInt();
        return array;
    }

    public int[][] nextIntTable(int rowCount, int columnCount) {
        int[][] table = new int[rowCount][];
        for (int i = 0; i < rowCount; i++)
            table[i] = nextIntArray(columnCount);
        return table;
    }

    public long[] nextLongArray(int size) {
        long[] array = new long[size];
        for (int i = 0; i < size; i++)
            array[i] = nextLong();
        return array;
    }

    public long[][] nextLongTable(int rowCount, int columnCount) {
        long[][] table = new long[rowCount][];
        for (int i = 0; i < rowCount; i++)
            table[i] = nextLongArray(columnCount);
        return table;
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\t' || isEOL(c);
    }

    public static boolean isEOL(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}


import java.io.File;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class p024 {
	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);
	}
}


import java.io.File;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class p024 {
	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>();
		for(int i=0;i<n;i++) {
			st.add(pt+v[i]);
			long ct = pt+t[i];
			long pv = 0;
			while(st.floor(ct)!=null) {
				long vl = st.floor(ct);
				st.remove(vl);
				pv+=vl-pt;
			}
			pv+=st.size()*t[i];
			pt=ct;
			sb.append(pv+" ");
		}
		System.out.println(sb);
	}
}


import java.io.*;
import java.util.*;
import java.math.*;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class ProducingSnow {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }
    static class TaskA {
        long mod = (long)(998244353l);
        public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
            while(testNumber-->0){
            	int n = in.nextInt();
            	long v[] = new long[n];
            	long t[] = new long[n];
            	for(int i=0;i<n;i++)
            		v[i] = in.nextLong();
            	for(int i=0;i<n;i++)
            		t[i] = in.nextLong();
            	PriorityQueue<Long> p = new PriorityQueue<>();
            	long sum = 0;
            	long ans[] = new long[n];
            	for(int i=0;i<n;i++){
            		long cal = Math.min(v[i] , t[i]);
            		long a1 = sum;
            		sum += t[i];
            		while(p.size()>0 && p.peek()<=sum){
            			cal += (p.poll() - a1);
            		}
            		cal += (t[i]*p.size());
            		if(v[i]>t[i])
	            		p.add(v[i] + a1);
            		// out.println(p);
	            	ans[i] = cal;
            	}
            	for(int i=0;i<n;i++)
            		out.print(ans[i] + " ");
            	out.println();
            }
        }
        public long cal(ArrayList<Long> a , long n){
        	long x = (1 + (long)Math.sqrt(1+8*n))/2;
        	a.add(x);
        	n -= (x*(x-1))/2;
        	// System.out.println(n);
        	return n;
        }
        public void sieve(int a[]){
            a[0] = a[1] = 1;
            int i;
            for(i=2;i*i<=a.length;i++){
                if(a[i] != 0)
                    continue;
                a[i] = i;
                for(int k = (i)*(i);k<a.length;k+=i){
                    if(a[k] != 0)
                        continue;
                    a[k] = i;
                }
            }
        }
        public int [][] matrixExpo(int c[][] , int n){
            int a[][] = new int[c.length][c[0].length];
            int b[][] = new int[a.length][a[0].length];
            for(int i=0;i<c.length;i++)
                for(int j=0;j<c[0].length;j++)
                    a[i][j] = c[i][j];
            for(int i=0;i<a.length;i++)
                b[i][i] = 1;
            while(n!=1){
                if(n%2 == 1){
                    b = matrixMultiply(a , a);
                    n--;
                }
                a = matrixMultiply(a , a);
                n/=2;
            }
            return matrixMultiply(a , b);
        }
        public int [][] matrixMultiply(int a[][] , int b[][]){
            int r1 = a.length;
            int c1 = a[0].length;
            int c2 = b[0].length;
            int c[][] = new int[r1][c2];
            for(int i=0;i<r1;i++){
                for(int j=0;j<c2;j++){
                    for(int k=0;k<c1;k++)
                        c[i][j] += a[i][k]*b[k][j];
                }
            }
            return c;
        }
        public long nCrPFermet(int n , int r , long p){
            if(r==0)
                return 1l;
            long fact[] = new long[n+1];
            fact[0] = 1;
            for(int i=1;i<=n;i++)
                fact[i] = (i*fact[i-1])%p;
            long modInverseR = pow(fact[r] , p-2 , 1l , p);
            long modInverseNR = pow(fact[n-r] , p-2 , 1l , p);
            long w = (((fact[n]*modInverseR)%p)*modInverseNR)%p;
            return w;
        }
        public long pow(long a , long b , long res , long mod){
            if(b==0)
                return res;
            if(b==1)
                return (res*a)%mod;
            if(b%2==1){
                res *= a;
                res %= mod;
                b--;
            }
            // System.out.println(a + " " + b + " " + res);
            return pow((a*a)%mod , b/2 , res , mod);
        }
        public long pow(long a , long b , long res){
            if(b == 0)
                return res;
            if(b==1)
                return res*a;
            if(b%2==1){
                res *= a;
                b--;
            }
            return pow(a*a , b/2 , res);
        }
        public void swap(int a[] , int p1 , int p2){
            int x = a[p1];
            a[p1] = a[p2];
            a[p2] = x;
        }
        public void sortedArrayToBST(TreeSet<Integer> a , int start, int end) {
            if (start > end) {
                return;
            }
            int mid = (start + end) / 2;
            a.add(mid);
            sortedArrayToBST(a, start, mid - 1);
            sortedArrayToBST(a, mid + 1, end);
        }
        class Combine{
            long value;
            long delete;
            Combine(long val , long delete){
                this.value = val;
                this.delete = delete;
            }
        }
        class Sort2 implements Comparator<Combine>{
            public int compare(Combine a , Combine b){
                if(a.value > b.value)
                    return 1;
                else if(a.value == b.value && a.delete>b.delete)
                    return 1;
                else if(a.value == b.value && a.delete == b.delete)
                    return 0;
                return -1;
            }
        }
        public int lowerLastBound(ArrayList<Integer> a , int x){
            int l = 0;
            int r = a.size()-1;
            if(a.get(l)>=x)
                return -1;
            if(a.get(r)<x)
                return r;
            int mid = -1;
            while(l<=r){
                mid = (l+r)/2;
                if(a.get(mid) == x && a.get(mid-1)<x)
                    return mid-1;
                else if(a.get(mid)>=x)
                    r = mid-1;
                else if(a.get(mid)<x && a.get(mid+1)>=x)
                    return mid;
                else if(a.get(mid)<x && a.get(mid+1)<x)
                    l = mid+1;
            }
            return mid;
        }
        public int upperFirstBound(ArrayList<Integer> a , Integer x){
            int l = 0;
            int r = a.size()-1;
            if(a.get(l)>x)
                return l;
            if(a.get(r)<=x)
                return r+1;
            int mid = -1;
            while(l<=r){
                mid = (l+r)/2;
                if(a.get(mid) == x && a.get(mid+1)>x)
                    return mid+1;
                else if(a.get(mid)<=x)
                    l = mid+1;
                else if(a.get(mid)>x && a.get(mid-1)<=x)
                    return mid;
                else if(a.get(mid)>x && a.get(mid-1)>x)
                    r = mid-1;
            }
            return mid;
        }
        public int lowerLastBound(int a[] , int x){
            int l = 0;
            int r = a.length-1;
            if(a[l]>=x)
                return -1;
            if(a[r]<x)
                return r;
            int mid = -1;
            while(l<=r){
                mid = (l+r)/2;
                if(a[mid] == x && a[mid-1]<x)
                    return mid-1;
                else if(a[mid]>=x)
                    r = mid-1;
                else if(a[mid]<x && a[mid+1]>=x)
                    return mid;
                else if(a[mid]<x && a[mid+1]<x)
                    l = mid+1;
            }
            return mid;
        }
        public int upperFirstBound(long a[] , long x){
            int l = 0;
            int r = a.length-1;
            if(a[l]>x)
                return l;
            if(a[r]<=x)
                return r+1;
            int mid = -1;
            while(l<=r){
                mid = (l+r)/2;
                if(a[mid] == x && a[mid+1]>x)
                    return mid+1;
                else if(a[mid]<=x)
                    l = mid+1;
                else if(a[mid]>x && a[mid-1]<=x)
                    return mid;
                else if(a[mid]>x && a[mid-1]>x)
                    r = mid-1;
            }
            return mid;
        }
        public long log(float number , int base){
            return (long) Math.floor((Math.log(number) / Math.log(base)));
        }
        public long gcd(long a , long b){
            if(a<b){
                long c = b;
                b = a;
                a = c;
            }
            if(b == 0)
                return a;
            return gcd(b , a%b);
        }
        public void print2d(long a[][] , PrintWriter out){
            for(int i=0;i<a.length;i++){
                for(int j=0;j<a[i].length;j++)
                    out.print(a[i][j] + " ");
                out.println();
            }
            out.println();
        }
        public void print1d(int a[] , PrintWriter out){
            for(int i=0;i<a.length;i++)
                out.print(a[i] + " ");
            out.println();
            out.println();
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class ProducingSnow {
	static long[]ends, pre,left;

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] v = new int[n];
		int[] t = new int[n];
		for (int i = 0; i < n; ++i)
			v[i] = sc.nextInt();
		for (int i = 0; i < n; ++i)
			t[i] = sc.nextInt();
		pre = new long[n+1];
		for (int i = 0; i < n; ++i)
			pre[i+1] = t[i] + pre[i];
		ends = new long[n];
		left = new long[n];
		for(int i = 0;i<n;++i) {
			int till = BS(i,v[i]);

		}
		long [] ans = new long[n];
		int rem = 0;
		PrintWriter out = new PrintWriter(System.out);
		for(int i = 0;i<n;++i) {
			rem += ends[i];
			ans[i] = (i-rem+1)*1l*t[i] + left[i];
			out.print(ans[i]+" ");
		}
		//System.err.println(Arrays.toString(ends));System.err.println(Arrays.toString(left));System.err.println(Arrays.toString(pre));
		out.flush();
		out.close();
	}
	static int BS(int start , int sum) {
		int lo = start ;
		int hi = pre.length - 2;
		int ans = -1;
		while(lo <= hi) {
			int mid = (lo + hi)/2;
			if(pre[mid+1] - pre[start] >= sum) {
				ans = mid;
				hi = mid - 1;
			}
			else
				lo = mid + 1;
		}
		if(ans>-1) {
			left[ans] += sum - (pre[ans] - pre[start]);
			ends[ans]++;
		}
		return 0;
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class ProducingSnow {
	static int[]ends, pre,left;

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] v = new int[n];
		int[] t = new int[n];
		for (int i = 0; i < n; ++i)
			v[i] = sc.nextInt();
		for (int i = 0; i < n; ++i)
			t[i] = sc.nextInt();
		pre = new int[n+1];
		for (int i = 0; i < n; ++i)
			pre[i+1] = t[i] + pre[i];
		ends = new int[n];
		left = new int[n];
		for(int i = 0;i<n;++i) {
			int till = BS(i,v[i]);

		}
		int [] ans = new int[n];
		int rem = 0;
		PrintWriter out = new PrintWriter(System.out);
		for(int i = 0;i<n;++i) {
			rem += ends[i];
			ans[i] = (i-rem+1)*t[i] + left[i];
			out.print(ans[i]+" ");
		}
		//System.err.println(Arrays.toString(ends));System.err.println(Arrays.toString(left));System.err.println(Arrays.toString(pre));
		out.flush();
		out.close();
	}
	static int BS(int start , int sum) {
		int lo = start ;
		int hi = pre.length - 2;
		int ans = -1;
		while(lo <= hi) {
			int mid = (lo + hi)/2;
			if(pre[mid+1] - pre[start] >= sum) {
				ans = mid;
				hi = mid - 1;
			}
			else
				lo = mid + 1;
		}
		if(ans>-1) {
			left[ans] += sum - (pre[ans] - pre[start]);
			ends[ans]++;
		}
		return 0;
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            int[] v = IOUtils.readIntArray(in, n);
            int[] t = IOUtils.readIntArray(in, n);
            long[] tCum = ArrayUtils.partialSums(t);
            int[] wholeDays = new int[n];
            long[] overflow = new long[n];
            for (int start = 0; start < v.length; start++) {
                int lowEnd = start;
                int highEnd = v.length - 1;
                while (lowEnd < highEnd) {
                    int midEnd = (lowEnd + highEnd) / 2;
                    long cum = tCum[midEnd + 1] - tCum[start];
                    if (cum >= v[start]) {
                        highEnd = midEnd;
                    } else {
                        lowEnd = midEnd + 1;
                    }
                }
                wholeDays[start]++;
                wholeDays[lowEnd]--;
                long extra = Math.min(v[start] - (tCum[lowEnd] - tCum[start]), t[lowEnd]);
                overflow[lowEnd] += extra;
                if (extra < 0) throw new RuntimeException();
            }
            int wholeDaysCompiled = 0;
            for (int day = 0; day < v.length; day++) {
                wholeDaysCompiled += wholeDays[day];
                long res = (long) wholeDaysCompiled * t[day] + overflow[day];
                out.print(res + " ");
            }
            out.printLine();
        }
    }
    static class ArrayUtils {
        public static long[] partialSums(int[] array) {
            long[] result = new long[array.length + 1];
            for (int i = 0; i < array.length; i++) {
                result[i + 1] = result[i] + array[i];
            }
            return result;
        }
    }
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
    static class IOUtils {
        public static int[] readIntArray(InputReader in, int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++) {
                array[i] = in.readInt();
            }
            return array;
        }
    }
    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void printLine() {
            writer.println();
        }

        public void close() {
            writer.close();
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.util.BitSet;
import java.util.HashSet;
import java.util.StringTokenizer;

public class Main {

    //------------------------------------------------------------------------------------------------------------------

    static final DecimalFormat FORMAT = new DecimalFormat("0.00");
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer tzer = new StringTokenizer("");

    static String next() throws IOException {
        while (!tzer.hasMoreTokens()) {
            tzer = new StringTokenizer(br.readLine());
        }
        return tzer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static int[] nextIntArr(int n) throws IOException {
        final int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = nextInt();
        }
        return arr;
    }

    static long[] nextLongArr(int n) throws IOException {
        final long[] arr = new long[n];
        for (int i = 0; i < n; i++) {
            arr[i] = nextInt();
        }
        return arr;
    }

    /**
     * @param n rows.
     * @param m cols.
     * @return matrix.
     * @throws IOException if IO error.
     */
    static int[][] nextIntMatr(int n, int m) throws IOException {
        final int[][] mat = new int[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                mat[i][j] = nextInt();
            }
        }
        return mat;
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    static int binsearchLeft(long[] a, long val, int left, int right) {
        if (left == right) return left;
        int mid = (left + right) / 2;
        if (a[mid] < val)
            return binsearchLeft(a, val, mid + 1, right);
        else
            return binsearchLeft(a, val, left, mid);
    }

    static int binsearchRight(long[] a, long val, int left, int right) {
        if (left == right) return left;
        int mid = (left + right + 1) / 2;
        if (a[mid] > val)
            return binsearchRight(a, val, left, mid - 1);
        else
            return binsearchRight(a, val, mid, right);
    }

    //------------------------------------------------------------------------------------------------------------------

    public static void main(String[] args) throws IOException {
        final int n = nextInt();
        final long[] v = nextLongArr(n);
        final long[] t = nextLongArr(n);
        final long[] tacc = new long[n];
        tacc[0] = t[0];
        for (int i = 1; i < n; i++) {
            tacc[i] = tacc[i - 1] + t[i];
        }
        final long[] r = new long[n];
        final long[] cnt = new long[n];

        for (int i = 0; i < n; i++) {
            long s = v[i] + (i == 0 ? 0 : tacc[i - 1]);
            int p = binsearchLeft(tacc, s, 0, tacc.length - 1);
            final long d = tacc[p] - s;
            if (d > 0) {
                r[p] += d;
            }
            if (p < n - 1) {
                cnt[p + 1]++;
            }
        }

        for (int i = 0, c = 0; i < n; i++) {
            c -= cnt[i] - 1;
            System.out.print(c * t[i] - r[i]);
            System.out.print(' ');
        }
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.util.BitSet;
import java.util.HashSet;
import java.util.StringTokenizer;

public class Main {

    //------------------------------------------------------------------------------------------------------------------

    static final DecimalFormat FORMAT = new DecimalFormat("0.00");
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer tzer = new StringTokenizer("");

    static String next() throws IOException {
        while (!tzer.hasMoreTokens()) {
            tzer = new StringTokenizer(br.readLine());
        }
        return tzer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static int[] nextIntArr(int n) throws IOException {
        final int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = nextInt();
        }
        return arr;
    }

    /**
     * @param n rows.
     * @param m cols.
     * @return matrix.
     * @throws IOException if IO error.
     */
    static int[][] nextIntMatr(int n, int m) throws IOException {
        final int[][] mat = new int[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                mat[i][j] = nextInt();
            }
        }
        return mat;
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    static int binsearchLeft(int[] a, int val, int left, int right) {
        if (left == right) return left;
        int mid = (left + right) / 2;
        if (a[mid] < val)
            return binsearchLeft(a, val, mid + 1, right);
        else
            return binsearchLeft(a, val, left, mid);
    }

    static int binsearchRight(int[] a, int val, int left, int right) {
        if (left == right) return left;
        int mid = (left + right + 1) / 2;
        if (a[mid] > val)
            return binsearchRight(a, val, left, mid - 1);
        else
            return binsearchRight(a, val, mid, right);
    }

    //------------------------------------------------------------------------------------------------------------------

    public static void main(String[] args) throws IOException {
        final int n = nextInt();
        final int[] v = nextIntArr(n);
        final int[] t = nextIntArr(n);
        final int[] tacc = new int[n];
        tacc[0] = t[0];
        for (int i = 1; i < n; i++) {
            tacc[i] = tacc[i - 1] + t[i];
        }
        final int[] r = new int[n];
        final int[] cnt = new int[n];

        for (int i = 0; i < n; i++) {
            int s = v[i] + (i == 0 ? 0 : tacc[i - 1]);
            int p = binsearchLeft(tacc, s, 0, tacc.length - 1);
//            System.out.println(p);
//            System.out.println(tacc[p]);
            final int d = tacc[p] - s;
            if (d > 0) {
                r[p] += d;
            }
            if (p < n - 1) {
                cnt[p + 1]++;
            }
        }

        for (int i = 0, c = 0; i < n; i++) {
            c -= cnt[i] - 1;
            System.out.print(c * t[i] - r[i]);
            System.out.print(' ');
        }
    }

}


import java.io.BufferedInputStream;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main extends Thread {

  //  private static JoltyScanner scanner = new JoltyScanner(System.in);
  private static Scanner scanner = new Scanner(System.in);
  private static TreeMap<Long, Set<Integer>> multiSet = new TreeMap<>();

  public static void main(String[] args) {
    int n = scanner.nextInt();
    long[] v = new long[n];
    for (int i = 0; i < n; i++) {
      v[i] = scanner.nextLong();
    }
    long[] t = new long[n];
    for (int i = 0; i < n; i++) {
      t[i] = scanner.nextLong();
    }

    long[] tSum = new long[n];
    tSum[0] = t[0];
    for (int i = 1; i < n; i++) {
      tSum[i] += tSum[i - 1] + t[i];
    }

    long[] vNew = new long[n];
    vNew[0] = v[0];
    for (int i = 1; i < n; i++) {
      vNew[i] = v[i] + tSum[i - 1];
    }

    long[] ans = new long[n];
    for (int i = 0; i < n; i++) {
      addToMultiSet(vNew[i], i);
      final long[] died = {0};
      int finalI = i;
      multiSet.headMap(tSum[i]).values().stream().flatMap(Collection::stream).forEach(pos -> {
        died[0] += vNew[pos] - tSum[finalI > 0 ? finalI - 1 : 0];
        died[0] = Math.max(0, died[0]);
      });
      multiSet.headMap(tSum[i]).clear();

      long alive = multiSet.values().stream().mapToLong(Collection::size).sum();
      ans[i] = died[0] + alive * t[i];

    }
//    for (int i = 0; i < n; i++) {
//      System.out.print(tSum[i] + " ");
//    }
//    System.out.println();
//    for (int i = 0; i < n; i++) {
//      System.out.print(vNew[i] + " ");
//    }
//    System.out.println();
    for (int i = 0; i < n; i++) {
      System.out.print(ans[i] + " ");
    }

  }

  private static void addToMultiSet(long key, int i) {
    if (!multiSet.containsKey(key)) {
      multiSet.put(key, new HashSet<>(Collections.singleton(i)));
    } else {
      multiSet.get(key).add(i);
    }
  }

  private static class Pair<X, Y> {
    public X x;
    public Y y;

    public Pair(X x, Y y) {
      this.x = x;
      this.y = y;
    }
  }

  static class JoltyScanner {
    public static final int BUFFER_SIZE = 1 << 16;
    public static final char NULL_CHAR = (char) -1;
    byte[] buffer = new byte[BUFFER_SIZE];
    int bufferIdx = 0, size = 0;
    char c = NULL_CHAR;
    BufferedInputStream in;

    public JoltyScanner(InputStream in) {
      this.in = new BufferedInputStream(in, BUFFER_SIZE);
      c = nextChar();
    }

    public int nextInt() {
      while (c < '0' || c > '9') {
        c = nextChar();
      }
      int res = 0;
      while (c >= '0' && c <= '9') {
        res = (res << 3) + (res << 1) + c - '0';
        c = nextChar();
      }
      return res;
    }

    public char nextChar() {
      while (bufferIdx == size) {
        try {
          size = in.read(buffer);
        } catch (Exception e) {
          return NULL_CHAR;
        }
        bufferIdx = 0;
      }
      return (char) buffer[bufferIdx++];
    }
  }

}


import java.io.BufferedInputStream;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main extends Thread {

  //  private static JoltyScanner scanner = new JoltyScanner(System.in);
  private static Scanner scanner = new Scanner(System.in);
  private static TreeSet<SnowMan> multiSet = new TreeSet<>();

  public static void main(String[] args) {
    int n = scanner.nextInt();
    long[] v = new long[n];
    for (int i = 0; i < n; i++) {
      v[i] = scanner.nextLong();
    }
    long[] t = new long[n];
    for (int i = 0; i < n; i++) {
      t[i] = scanner.nextLong();
    }

    long[] tSum = new long[n];
    tSum[0] = t[0];
    for (int i = 1; i < n; i++) {
      tSum[i] += tSum[i - 1] + t[i];
    }

    long[] vNew = new long[n];
    vNew[0] = v[0];
    for (int i = 1; i < n; i++) {
      vNew[i] = v[i] + tSum[i - 1];
    }

    long[] ans = new long[n];
    for (int i = 0; i < n; i++) {
      multiSet.add(new SnowMan(vNew[i], i));
      final long[] died = {0};
      int finalI = i;
      multiSet.headSet(new SnowMan(tSum[i])).forEach(snowMan -> {
        died[0] += snowMan.snow - (finalI != 0 ? tSum[finalI - 1] : 0);
      });

      multiSet.headSet(new SnowMan(tSum[i])).clear();

      long alive = multiSet.size();
      ans[i] = died[0] + alive * t[i];

    }

    for (int i = 0; i < n; i++) {
      System.out.print(ans[i] + " ");
    }

  }

  private static class SnowMan implements Comparable<SnowMan> {
    public Long snow;
    public Integer pos;

    public SnowMan(Long snow, Integer pos) {
      this.snow = snow;
      this.pos = pos;
    }

    public SnowMan(Long snow) {
      this.snow = snow;
      this.pos = 1000000000;
    }

    @Override
    public int compareTo(SnowMan o) {
      if (this.snow.equals(o.snow)) {
        return this.pos.compareTo(o.pos);
      }
      return this.snow.compareTo(o.snow);
    }
  }

  private static class Pair<X, Y> {
    public X x;
    public Y y;

    public Pair(X x, Y y) {
      this.x = x;
      this.y = y;
    }
  }

  static class JoltyScanner {
    public static final int BUFFER_SIZE = 1 << 16;
    public static final char NULL_CHAR = (char) -1;
    byte[] buffer = new byte[BUFFER_SIZE];
    int bufferIdx = 0, size = 0;
    char c = NULL_CHAR;
    BufferedInputStream in;

    public JoltyScanner(InputStream in) {
      this.in = new BufferedInputStream(in, BUFFER_SIZE);
      c = nextChar();
    }

    public int nextInt() {
      while (c < '0' || c > '9') {
        c = nextChar();
      }
      int res = 0;
      while (c >= '0' && c <= '9') {
        res = (res << 3) + (res << 1) + c - '0';
        c = nextChar();
      }
      return res;
    }

    public char nextChar() {
      while (bufferIdx == size) {
        try {
          size = in.read(buffer);
        } catch (Exception e) {
          return NULL_CHAR;
        }
        bufferIdx = 0;
      }
      return (char) buffer[bufferIdx++];
    }
  }

}


import java.io.BufferedInputStream;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main extends Thread {

  //  private static JoltyScanner scanner = new JoltyScanner(System.in);
  private static Scanner scanner = new Scanner(System.in);
  private static TreeSet<SnowMan> multiSet = new TreeSet<>();

  public static void main(String[] args) {
    int n = scanner.nextInt();
    long[] v = new long[n];
    for (int i = 0; i < n; i++) {
      v[i] = scanner.nextLong();
    }
    long[] t = new long[n];
    for (int i = 0; i < n; i++) {
      t[i] = scanner.nextLong();
    }

    long[] tSum = new long[n];
    tSum[0] = t[0];
    for (int i = 1; i < n; i++) {
      tSum[i] += tSum[i - 1] + t[i];
    }

    long[] vNew = new long[n];
    vNew[0] = v[0];
    for (int i = 1; i < n; i++) {
      vNew[i] = v[i] + tSum[i - 1];
    }

    long[] ans = new long[n];
    for (int i = 0; i < n; i++) {
      multiSet.add(new SnowMan(vNew[i], i));
      long prevDayMelted = i != 0 ? tSum[i - 1] : 0;
      long died = multiSet.headSet(new SnowMan(tSum[i])).stream().mapToLong(snowMan -> snowMan.snow - prevDayMelted).sum();
      multiSet.headSet(new SnowMan(tSum[i])).clear();
      long alive = multiSet.size();
      ans[i] = died + alive * t[i];

    }

    for (int i = 0; i < n; i++) {
      System.out.print(ans[i] + " ");
    }

  }

  private static class SnowMan implements Comparable<SnowMan> {
    public Long snow;
    public Integer pos;

    public SnowMan(Long snow, Integer pos) {
      this.snow = snow;
      this.pos = pos;
    }

    public SnowMan(Long snow) {
      this.snow = snow;
      this.pos = 1000000000;
    }

    @Override
    public int compareTo(SnowMan o) {
      if (this.snow.equals(o.snow)) {
        return this.pos.compareTo(o.pos);
      }
      return this.snow.compareTo(o.snow);
    }
  }

  private static class Pair<X, Y> {
    public X x;
    public Y y;

    public Pair(X x, Y y) {
      this.x = x;
      this.y = y;
    }
  }

  static class JoltyScanner {
    public static final int BUFFER_SIZE = 1 << 16;
    public static final char NULL_CHAR = (char) -1;
    byte[] buffer = new byte[BUFFER_SIZE];
    int bufferIdx = 0, size = 0;
    char c = NULL_CHAR;
    BufferedInputStream in;

    public JoltyScanner(InputStream in) {
      this.in = new BufferedInputStream(in, BUFFER_SIZE);
      c = nextChar();
    }

    public int nextInt() {
      while (c < '0' || c > '9') {
        c = nextChar();
      }
      int res = 0;
      while (c >= '0' && c <= '9') {
        res = (res << 3) + (res << 1) + c - '0';
        c = nextChar();
      }
      return res;
    }

    public char nextChar() {
      while (bufferIdx == size) {
        try {
          size = in.read(buffer);
        } catch (Exception e) {
          return NULL_CHAR;
        }
        bufferIdx = 0;
      }
      return (char) buffer[bufferIdx++];
    }
  }

}


import java.io.BufferedInputStream;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main extends Thread {

  //  private static JoltyScanner scanner = new JoltyScanner(System.in);
  private static Scanner scanner = new Scanner(System.in);
  private static TreeMap<Long, Set<Integer>> multiSet = new TreeMap<>();

  public static void main(String[] args) {
    int n = scanner.nextInt();
    long[] v = new long[n];
    for (int i = 0; i < n; i++) {
      v[i] = scanner.nextLong();
    }
    long[] t = new long[n];
    for (int i = 0; i < n; i++) {
      t[i] = scanner.nextLong();
    }

    long[] tSum = new long[n];
    tSum[0] = t[0];
    for (int i = 1; i < n; i++) {
      tSum[i] += tSum[i - 1] + t[i];
    }

    long[] vNew = new long[n];
    vNew[0] = v[0];
    for (int i = 1; i < n; i++) {
      vNew[i] = v[i] + tSum[i - 1];
    }

    long[] ans = new long[n];
    for (int i = 0; i < n; i++) {
      addToMultiSet(vNew[i], i);
      final long[] died = {0};
      int finalI = i;
      multiSet.headMap(tSum[i]).values().stream().flatMap(Collection::stream).forEach(pos -> {
        died[0] += vNew[pos] - tSum[finalI > 0 ? finalI - 1 : 0];
      });
      multiSet.headMap(tSum[i]).clear();

      long alive = multiSet.values().stream().mapToLong(Collection::size).sum();
      ans[i] = died[0] + alive * t[i];

    }
//    for (int i = 0; i < n; i++) {
//      System.out.print(tSum[i] + " ");
//    }
//    System.out.println();
//    for (int i = 0; i < n; i++) {
//      System.out.print(vNew[i] + " ");
//    }
//    System.out.println();
    for (int i = 0; i < n; i++) {
      System.out.print(ans[i] + " ");
    }

  }

  private static void addToMultiSet(long key, int i) {
    if (!multiSet.containsKey(key)) {
      multiSet.put(key, new HashSet<>(Collections.singleton(i)));
    } else {
      multiSet.get(key).add(i);
    }
  }

  private static class Pair<X, Y> {
    public X x;
    public Y y;

    public Pair(X x, Y y) {
      this.x = x;
      this.y = y;
    }
  }

  static class JoltyScanner {
    public static final int BUFFER_SIZE = 1 << 16;
    public static final char NULL_CHAR = (char) -1;
    byte[] buffer = new byte[BUFFER_SIZE];
    int bufferIdx = 0, size = 0;
    char c = NULL_CHAR;
    BufferedInputStream in;

    public JoltyScanner(InputStream in) {
      this.in = new BufferedInputStream(in, BUFFER_SIZE);
      c = nextChar();
    }

    public int nextInt() {
      while (c < '0' || c > '9') {
        c = nextChar();
      }
      int res = 0;
      while (c >= '0' && c <= '9') {
        res = (res << 3) + (res << 1) + c - '0';
        c = nextChar();
      }
      return res;
    }

    public char nextChar() {
      while (bufferIdx == size) {
        try {
          size = in.read(buffer);
        } catch (Exception e) {
          return NULL_CHAR;
        }
        bufferIdx = 0;
      }
      return (char) buffer[bufferIdx++];
    }
  }

}


import java.io.BufferedInputStream;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main extends Thread {

  //  private static JoltyScanner scanner = new JoltyScanner(System.in);
  private static Scanner scanner = new Scanner(System.in);
  private static TreeSet<SnowMan> multiSet = new TreeSet<>();

  public static void main(String[] args) {
    int n = scanner.nextInt();
    long[] v = new long[n];
    for (int i = 0; i < n; i++) {
      v[i] = scanner.nextLong();
    }
    long[] t = new long[n];
    for (int i = 0; i < n; i++) {
      t[i] = scanner.nextLong();
    }

    long[] tSum = new long[n];
    tSum[0] = t[0];
    for (int i = 1; i < n; i++) {
      tSum[i] += tSum[i - 1] + t[i];
    }

    long[] vNew = new long[n];
    vNew[0] = v[0];
    for (int i = 1; i < n; i++) {
      vNew[i] = v[i] + tSum[i - 1];
    }

    long[] ans = new long[n];
    for (int i = 0; i < n; i++) {
      multiSet.add(new SnowMan(vNew[i], i));
      final long[] died = {0};
      int finalI = i;
      multiSet.headSet(new SnowMan(tSum[i])).forEach(snowMan -> {
        died[0] += vNew[snowMan.pos] - tSum[finalI > 0 ? finalI - 1 : 0];
        died[0] = Math.max(0, died[0]);
      });

      multiSet.headSet(new SnowMan(tSum[i])).clear();

      long alive = multiSet.size();
      ans[i] = died[0] + alive * t[i];

    }

    for (int i = 0; i < n; i++) {
      System.out.print(ans[i] + " ");
    }

  }

  private static class SnowMan implements Comparable<SnowMan> {
    public Long snow;
    public Integer pos;

    public SnowMan(Long snow, Integer pos) {
      this.snow = snow;
      this.pos = pos;
    }

    public SnowMan(Long snow) {
      this.snow = snow;
      this.pos = 1000000000;
    }

    @Override
    public int compareTo(SnowMan o) {
      if (this.snow.equals(o.snow)) {
        return this.pos.compareTo(o.pos);
      }
      return this.snow.compareTo(o.snow);
    }
  }

  private static class Pair<X, Y> {
    public X x;
    public Y y;

    public Pair(X x, Y y) {
      this.x = x;
      this.y = y;
    }
  }

  static class JoltyScanner {
    public static final int BUFFER_SIZE = 1 << 16;
    public static final char NULL_CHAR = (char) -1;
    byte[] buffer = new byte[BUFFER_SIZE];
    int bufferIdx = 0, size = 0;
    char c = NULL_CHAR;
    BufferedInputStream in;

    public JoltyScanner(InputStream in) {
      this.in = new BufferedInputStream(in, BUFFER_SIZE);
      c = nextChar();
    }

    public int nextInt() {
      while (c < '0' || c > '9') {
        c = nextChar();
      }
      int res = 0;
      while (c >= '0' && c <= '9') {
        res = (res << 3) + (res << 1) + c - '0';
        c = nextChar();
      }
      return res;
    }

    public char nextChar() {
      while (bufferIdx == size) {
        try {
          size = in.read(buffer);
        } catch (Exception e) {
          return NULL_CHAR;
        }
        bufferIdx = 0;
      }
      return (char) buffer[bufferIdx++];
    }
  }

}


import java.io.BufferedInputStream;
import java.io.InputStream;
import java.util.Scanner;
import java.util.TreeSet;

public class Main extends Thread {

  //  private static JoltyScanner scanner = new JoltyScanner(System.in);
  private static Scanner scanner = new Scanner(System.in);
  private static TreeSet<MyPair> multiSet = new TreeSet<>();
  private static TreeSet<MyPair> sumMelt = new TreeSet<>();

  public static void main(String[] args) {
    int n = scanner.nextInt();
    long[] v = new long[n];
    for (int i = 0; i < n; i++) {
      v[i] = scanner.nextLong();
    }
    long[] t = new long[n];
    for (int i = 0; i < n; i++) {
      t[i] = scanner.nextLong();
    }

    long[] tSum = new long[n];
    tSum[0] = t[0];
    for (int i = 1; i < n; i++) {
      tSum[i] += tSum[i - 1] + t[i];
    }

    long[] vNew = new long[n];
    vNew[0] = v[0];
    for (int i = 1; i < n; i++) {
      vNew[i] = v[i] + tSum[i - 1];
    }

    long[] deathsInDay = new long[n];
    long[] meltedInDay = new long[n];

    TreeSet<MyPair> tSumSet = new TreeSet<>();
    for (int i = 0; i < n; i++) {
      tSumSet.add(new MyPair(tSum[i], i));
    }

    for (int i = 0; i < n; i++) {
      MyPair ceiling = tSumSet.ceiling(new MyPair(vNew[i], -1));
      if (ceiling != null) {
        int dayToDie = ceiling.pos;
        deathsInDay[dayToDie]++;
        long prevDayMelted = dayToDie != 0 ? tSum[dayToDie - 1] : 0;
        meltedInDay[dayToDie] += vNew[i] - prevDayMelted;
      }
    }

    long[] aliveGuysInDay = new long[n];

    int currentDeathCount = 0;
    for (int i = 0; i < n; i++) {
      currentDeathCount += deathsInDay[i];
      aliveGuysInDay[i] = i - currentDeathCount + 1;
    }

    long[] ans = new long[n];

    for (int i = 0; i < n; i++) {
      ans[i] = meltedInDay[i] + t[i] * aliveGuysInDay[i];
    }

//    print(n, deathsInDay);
//    print(n, meltedInDay);
//    print(n, aliveGuysInDay);
    print(n, ans);
//    for (int i = 0; i < n; i++) {
//      multiSet.add(new MyPair(vNew[i], i));
//      long prevDayMelted = i != 0 ? tSum[i - 1] : 0;
//      long died = multiSet.headSet(new MyPair(tSum[i])).stream().mapToLong(myPair -> myPair.snow - prevDayMelted).sum();
//      multiSet.headSet(new MyPair(tSum[i])).clear();
//      long alive = multiSet.size();
//      ans[i] = died + alive * t[i];
//    }

  }

  private static void print(int n, long[] ans) {
//    System.out.println();
    for (int i = 0; i < n; i++) {
      System.out.print(ans[i] + " ");
    }
  }

  private static class MyPair implements Comparable<MyPair> {
    public Long snow;
    public Integer pos;

    public MyPair(Long snow, Integer pos) {
      this.snow = snow;
      this.pos = pos;
    }

    public MyPair(Long snow) {
      this.snow = snow;
      this.pos = 1000000000;
    }

    @Override
    public int compareTo(MyPair o) {
      if (this.snow.equals(o.snow)) {
        return this.pos.compareTo(o.pos);
      }
      return this.snow.compareTo(o.snow);
    }
  }

  private static class Pair<X, Y> {
    public X x;
    public Y y;

    public Pair(X x, Y y) {
      this.x = x;
      this.y = y;
    }
  }

  static class JoltyScanner {
    public static final int BUFFER_SIZE = 1 << 16;
    public static final char NULL_CHAR = (char) -1;
    byte[] buffer = new byte[BUFFER_SIZE];
    int bufferIdx = 0, size = 0;
    char c = NULL_CHAR;
    BufferedInputStream in;

    public JoltyScanner(InputStream in) {
      this.in = new BufferedInputStream(in, BUFFER_SIZE);
      c = nextChar();
    }

    public int nextInt() {
      while (c < '0' || c > '9') {
        c = nextChar();
      }
      int res = 0;
      while (c >= '0' && c <= '9') {
        res = (res << 3) + (res << 1) + c - '0';
        c = nextChar();
      }
      return res;
    }

    public char nextChar() {
      while (bufferIdx == size) {
        try {
          size = in.read(buffer);
        } catch (Exception e) {
          return NULL_CHAR;
        }
        bufferIdx = 0;
      }
      return (char) buffer[bufferIdx++];
    }
  }

}


import java.io.*;
import java.util.*;

public class MainB {
	static final StdIn in = new StdIn();
	static final PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) {
		int n=in.nextInt();
		long[] v = in.readLongArray(n, 0), t=in.readLongArray(n, 0);
		long[] pt = new long[n+1], ans = new long[n+1], a2 = new long[n];
		for(int i=0; i<n; ++i)
			pt[i+1]=pt[i]+t[i];
		for(int i=0; i<n; ++i) {
			int lb=i, rb=n;
			while(lb<=rb) {
				int m=(lb+rb)/2;
				if(pt[m]-pt[i]<=v[i])
					lb=m+1;
				else
					rb=m-1;
			}
			ans[rb]+=v[i]-pt[rb]+pt[i];
			if(rb>0)
				++a2[rb-1];
			if(i>0)
				--a2[i-1];
		}
		for(int i=n-2; i>=0; --i)
			a2[i]+=a2[i+1];

		for(int i=0; i<n; ++i)
			out.print((a2[i]*t[i]+ans[i])+" ");
		out.close();
	}

	static class StdIn {
		final private int BUFFER_SIZE = 1 << 16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer, bytesRead;
		public StdIn() {
			din = new DataInputStream(System.in);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}
		public StdIn(InputStream in) {
			try{
				din = new DataInputStream(in);
			} catch(Exception e) {
				throw new RuntimeException();
			}
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}
		public String next() {
			int c;
			while((c=read())!=-1&&(c==' '||c=='\n'||c=='\r'));
			StringBuilder s = new StringBuilder();
			while (c != -1)
			{
				if (c == ' ' || c == '\n'||c=='\r')
					break;
				s.append((char)c);
				c=read();
			}
			return s.toString();
		}
		public String nextLine() {
			int c;
			while((c=read())!=-1&&(c==' '||c=='\n'||c=='\r'));
			StringBuilder s = new StringBuilder();
			while (c != -1)
			{
				if (c == '\n'||c=='\r')
					break;
				s.append((char)c);
				c = read();
			}
			return s.toString();
		}
		public int nextInt() {
			int ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do
				ret = ret * 10 + c - '0';
			while ((c = read()) >= '0' && c <= '9');

			if (neg)
				return -ret;
			return ret;
		}
		public int[] readIntArray(int n, int os) {
			int[] ar = new int[n];
			for(int i=0; i<n; ++i)
				ar[i]=nextInt()+os;
			return ar;
		}
		public long nextLong() {
			long ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do
				ret = ret * 10 + c - '0';
			while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}
		public long[] readLongArray(int n, long os) {
			long[] ar = new long[n];
			for(int i=0; i<n; ++i)
				ar[i]=nextLong()+os;
			return ar;
		}
		public double nextDouble() {
			double ret = 0, div = 1;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do
				ret = ret * 10 + c - '0';
			while ((c = read()) >= '0' && c <= '9');
			if (c == '.')
				while ((c = read()) >= '0' && c <= '9')
					ret += (c - '0') / (div *= 10);
			if (neg)
				return -ret;
			return ret;
		}
		private void fillBuffer() throws IOException {
			bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			if (bytesRead == -1)
				buffer[0] = -1;
		}
		private byte read() {
			try{
				if (bufferPointer == bytesRead)
					fillBuffer();
				return buffer[bufferPointer++];
			} catch(IOException e) {
				throw new RuntimeException();
			}
		}
		public void close() throws IOException {
			if (din == null)
				return;
			din.close();
		}
	}
}