Krazy Golf


MAPS Team is keeping up with the kids, and wants to revitalise Golf, a historically slow and methodical sport, with the hyper-popular gaming trend of a battle royale!

The golf course is a standard nn-hole course, however the scoring has been changed, because it makes way more sense for a higher score to mean a better golfer!

Each hole nets the player a certain amount of points, which accumulates throughout the course. However, at the end of every hole, there is a gate. If you do not have at least gig_i points, then you are eliminated from the competition!

One of the competitors, Lauren, has given you their scorecard - how many points they would likely score in each of the nn holes. She'd like to know how many holes she will get to play before being eliminated.

However, you don't always need to run the full nn-hole course for the competition - you're allowed to start at any of the holes, as long as you complete each consecutive hole until hole nn, or you are eliminated.

You'd like to know, for every possible starting hole - how many holes Lauren would be able to play before being eliminated.

Input

Input will begin with a single integer nn (1≤n≤3×1051 \leq n \leq 3\times 10^5) - the number of holes in the course.

2 lines will follow, each containing nn integers.

The first line specifies the gate values gig_i (0≤gi≤1090 \leq g_i \leq 10^9) - If, after completing hole ii, you do not have gig_i points, you are eliminated from the competition!

The second specifies the point values pip_i (0≤pi≤1090 \leq p_i \leq 10^9) - How many points Lauren can expect to receive from hole ii.

Output

Output nn integers - representing how many holes Lauren would be able to play if starting at hole 1, 2, 3, …\ldots nn.

Example 1

Input 1
5
1 4 1 2 5
3 1 2 1 1
Output 1
5 1 3 1 1
Explanation

The reasoning for the sample output is provided below:

Comments0


No comments yet

Be the first to comment.

New comment


Log in to join the discussion.