Problem1301--元素插入有序数组

1301: 元素插入有序数组

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 112  Solved: 49
[Status] [Submit] [Creator:]

Description

给你一个整数n和一个数列,这个数列保证从小到大排列,现要求将这个整数n插入到数列中,使新的数列仍然从小到大排列。

Input

第一行一个整数n :等待插入的数 
第二行一个整数m :数列中数的个数 
第三行m个整数(空格隔开)

Output

一行整数:新的数列(空格隔开)

Sample Input Copy

2
4
1 3 4 5

Sample Output Copy

1 2 3 4 5

Source/Category