

実行時間制限: 2 sec / メモリ制限: 1024 MiB
配点 : 100 点
問題文
長さ N の整数列 A と整数 K,X が与えられます。
整数列 A の K 要素目の直後に整数 X を 1 つ挿入した整数列 B を出力してください。
制約
- 入力は全て整数
- 1 \le K \le N \le 100
- 1 \le A_i,X \le 100
入力
入力は以下の形式で標準入力から与えられる。
N K X A_1 A_2 \dots A_N
出力
整数列 A の K 要素目の直後に整数 X を 1 つ挿入した整数列 B を、以下の形式で出力せよ。
B_1 B_2 \dots B_{N+1}
入力例 1
4 3 7 2 3 5 11
出力例 1
2 3 5 7 11
K=3, X=7, A=(2,3,5,11) のとき、 B=(2,3,5,7,11) です。
入力例 2
1 1 100 100
出力例 2
100 100
入力例 3
8 8 3 9 9 8 2 4 4 3 5
出力例 3
9 9 8 2 4 4 3 5 3
Score : 100 points
Problem Statement
You are given an integer sequence A of length N and integers K and X.
Print the integer sequence B obtained by inserting the integer X immediately after the K-th element of the sequence A.
Constraints
- All input values are integers.
- 1 \le K \le N \le 100
- 1 \le A_i, X \le 100
Input
The input is given from Standard Input in the following format:
N K X A_1 A_2 \dots A_N
Output
Print the integer sequence B obtained by inserting the integer X immediately after the K-th element of the sequence A, in the following format:
B_1 B_2 \dots B_{N+1}
Sample Input 1
4 3 7 2 3 5 11
Sample Output 1
2 3 5 7 11
For K=3, X=7, and A=(2,3,5,11), we get B=(2,3,5,7,11).
Sample Input 2
1 1 100 100
Sample Output 2
100 100
Sample Input 3
8 8 3 9 9 8 2 4 4 3 5
Sample Output 3
9 9 8 2 4 4 3 5 3