Alpha and His array
/

## Multiset, Segment Trees

Problem
Editorial
Analytics

Rohit has given array A and array D with n elements.

On ith day,

Rohit performs an operation for each 1 ≤ j ≤ i

A[ j ] = A[ j ] - D[ i ]     ,if A[ j ] >= D[ i ]            (Decreased Aj by Di)

A[ j ] = 0                       ,otherwise                    (Decreased Aj by Aj)

Now for each day i (1<=i<=N) you have to tell the total value decreased by Rohit

Input Format:

The first line of input will contain single integer N.

Next line will contain N integers, denoting array A

Next line is left blank.

Next line will contain N integers, denoting array D

Output Format:

Output N integer separated by space which denotes Total value decreased by Rohit on ith day.

Constraints :

$1 \le N \le 100000$

$1 \le Ai \le 1000000000$

$1 \le Di \le 1000000000$

SAMPLE INPUT
5
3 5 6 5 2

3 9 1 1 7

SAMPLE OUTPUT
3 5 1 2 10

Time Limit: 1.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB

## Contributors

Initializing Code Editor...