1803: 【CSP数组】元素插入有序数组▅

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:7 Solved:5

Description

给你一个整数 lns="http://www.w3.org/1998/Math/MathML">n 和一个数列(数列个数不超过 lns="http://www.w3.org/1998/Math/MathML">1000 ),这个数列保证从小到大排列,现要求将这个整数 lns="http://www.w3.org/1998/Math/MathML">n 插入到数列中,使新的数列仍然从小到大排列。

Input

第一行一个整数 lns="http://www.w3.org/1998/Math/MathML">n 表示等待插入的数 ;

第二行一个整数 lns="http://www.w3.org/1998/Math/MathML">m 表示数列中数的个数;

第三行 lns="http://www.w3.org/1998/Math/MathML">m 个整数(空格隔开)。

Output

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

Sample Input Copy

3
3
4 6 8

Sample Output Copy

3 4 6 8