1803: 【CSP数组】元素插入有序数组▅
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:7
Solved:5
Description
给你一个整数 n 和一个数列(数列个数不超过 1000 ),这个数列保证从小到大排列,现要求将这个整数 n 插入到数列中,使新的数列仍然从小到大排列。
Input
第一行一个整数 n 表示等待插入的数 ;
第二行一个整数 m 表示数列中数的个数;
第三行 m 个整数(空格隔开)。
Output
一行整数:新的数列(空格隔开)。
Sample Input Copy
3
3
4 6 8
Sample Output Copy
3 4 6 8