1618: 【入门】元素插入有序数组

Memory Limit:16 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:3 Solved:3

Description

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

Input

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

Output

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

Sample Input Copy

2
4
1 3 4 5

Sample Output Copy

1 2 3 4 5