99. Victim Logs

Time Limit: 1 seconds

Memory Limit: 256 MB

Rating: 800

Problem Statement

Two separate reports document the sequence of events. Merge them into one sorted log to piece together the timeline. Our admins will make sure you've done this correctly or else you'll pay some big consequences!

Input

You are given two space-separated integers $N$ and $M$, followed by a line of $N$ integers $A_i$ and a line of $M$ integers $B_i$. Arrays $A$ and $B$ are space-separated as well. $1 \le N \le 50{,}000$ $1 \le M \le 50{,}000$ $-10^9 \le A_i, B_i \le 10^9$

Output

Output $A$ and $B$ merged together in a single line, in ascending order.

Sample Cases
Sample Input 1:
2 2
1 2
3 4

Sample Output 1:
1 2 3 4
Explanation

Merge the two lists into $[1, 2, 3, 4]$.

Sources

KL Coding Cup March 2025 > Speed Round > Problem 4

Submit | Back