#78Easy
Insert an element
Time: 1 s · Memory: 256 MB
- Arrays
Statement
You are given an array of numbers and a number . Insert a new element, , before the -th element.
Input format
The first line contains and (). The second line contains integers (). Elements are numbered from .
Output format
A single line with numbers — the new array.
Examples
Input
6 3 3 5 3 5 2 5
Output
3 5 0 3 5 2 5
Input
1 1 9
Output
0 9
Note
Grow the array by one and shift every element from the -th onwards one position to the right — starting from the end, otherwise the values overwrite each other. Then write into the freed place.
