#P1631. 序列合并

序列合并

Description

There are two length-NN non-decreasing sequences A,BA, B. Taking one number from AA and one number from BB and adding them yields N2N^2 sums. Find the smallest NN sums among these N2N^2 sums.

Input Format

The first line contains a positive integer NN.

The second line contains NN integers A1NA_{1\dots N}.

The third line contains NN integers B1NB_{1\dots N}.

Output Format

Output one line with NN integers, from smallest to largest, representing these NN smallest sums.

3
2 6 6
1 4 8
3 6 7

Hint

For 50%50\% of the testdata, N103N \le 10^3.

For 100%100\% of the testdata, 1N1051 \le N \le 10^5, 1ai,bi1091 \le a_i, b_i \le 10^9.

Translated by ChatGPT 5