Implement Merge Sort

Easy

Given an array, sort it using merge sort.

Testing

Input Format

The first line contains 'T' denoting the no. of test cases.

Next T lines each contain a number 'n' denoting the number of elements, followed by n space-separated numbers denoting the array elements.

Output Format

T lines contain n numbers denoting the sorted array.

Sample Input

2
5 4 2 5 3 1
3 11 4 200

Expected Output

1 2 3 4 5
4 11 200

Constraints

0 <= T <= 100

1 <= N <= 5000

1 <= array element <= 106

Editorial Link: Editorial