13621362 SUSTech Online Judge
Problem 1362 --[Easy I] Merge

1362: [Easy I] Merge

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 1221  Solved: 275
[Submit][Status][Web Board]

Description

Merge is an essiential step when you implement Merge Sort Algorithm. That is, given two sorted arrays, you need to combine them to one sorted array. Lanran gets puzzled at how to implement Merge operation, could you help him?

Input

The first line contains an integer T(1 ≤ T ≤10), representing the number of test cases. 

In each test case, the first line will be two integers n and m, which are the lengths of the two sorted arrays in the ascending order.   

The second line will be the terms of the first array.  

The third line will be the terms of the second array. (1 <= n, m <= 105, the combat values will in the range of [0, 109])

Output

For each test case, print the combined array.

Sample Input

1
4 5
1 2 3 4
1 2 3 4 5

Sample Output

1 1 2 2 3 3 4 4 5

HINT

Source

 

[Submit][Status]