New students. Inserting elements into an array
Problem
The class has
N
students (
\(5<=N<=25\)). Student heights are stored in a descending sorted array. At the beginning of the school year, two new students of height
A
and
B
entered the class. Write a program that adds the height of new students to an array. The resulting array must also be sorted in descending order. The program must not use data sorting.
Input data
At the input,
N
is the number of students in the class. The second line contains the number
A
and the number
B.
The third line contains < code>N numbers - array element values. Values are in descending order.
Imprint data
Print the resulting array on one line.
Examples
# |
Input |
Output |
1 |
5
160 170
180 175 163 154 150
| 180 175 170 163 160 154 150 |
Запрещенные операторы: insert
; pop
; del
; remove
; index
; sort