13084 - Merge Two Arrays   

Description

Given two sorted arrays, implement the function merge(). Note that the two arrays are assumed to be next to each other (with contagious memory locations), and the first array is ahead of the second. You should replace the original two arrays by the result.

Input

The first line consists of two integers, one is the size of the first array and the other is the size of the second array.

The second line consists both elements in the first array and the second array (no newline).

Both arrays should be in increasing order.

Output

The first line is the size of the merged array.

The second line is the elements of the merged array.

There should be a newline at the end of the ouput!

Sample Input  Download

Sample Output  Download

Partial Judge Code

13084.c

Partial Judge Header

13084.h

Tags




Discuss