Description

給你兩個長度皆為n的數列A[i]B[i]

對於數列C

C[i]=maxB[i]ji(A[j])

且保證 0B[i1]B[i]i

請輸出整個數列 C

Input Format

a[0]a[1]a[2]a[3]...a[n1]
b[0]b[1]b[2]b[3]...b[n1]
1n107
0ai1000

0B[i1]B[i]i

Output Format

請輸出整個數列 C

Sample Input 1

5
1 2 6 4 5
0 0 0 0 0

Sample Output 1

1 2 6 6 6 

Sample Input 2

5
2 23 1 12 203
0 0 1 2 3

Sample Output 2

2 23 23 12 203 

Hints

好無聊好單調喔

Subtasks

No. Testdata Range Score

TopCoder

FHVirus
你好,我是一條鱸蛇

User's AC Ratio

81.8% (9/11)

Tags

Problem Source

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Memory Limit (RSS, KiB) Output Limit (KiB) Subtasks
0 2500 250000 250000 65536
1 2500 250000 250000 65536
2 2500 250000 250000 65536
3 2500 250000 250000 65536
4 2500 250000 250000 65536