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 Ai and a line of M integers Bi. Arrays A and B are space-separated as well.

1N50,000
1M50,000
109Ai,Bi109

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