cswork / OA打开练习工作台

IBMOA #54

Merge 2 Arrays

估计简单可在线判题

考点(AI 标注)双指针滑窗

Merge two non-decreasing arrays, each of length n, and output all 2n elements, keeping duplicates.

输入格式

The first line contains n, the second line contains array a, and the third line contains array b. Full original ranges: 2≤n≤100000, 0≤a[i],b[i]≤10^9, and both arrays are sorted.

输出格式

Output the 2n integers in non-decreasing order.

样例 1

输入:

3
1 2 3
2 5 5

输出:

1 2 2 3 5 5

样例 2

输入:

2
0 0
0 1

输出:

0 0 0 1

样例 3

输入:

2
9 10
1 2

输出:

1 2 9 10

样例说明

The examples give 1 2 2 3 5 5; 0 0 0 1; and 1 2 9 10 respectively.