103610: [Atcoder]ABC361 A - Insert
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:5
Solved:0
Description
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
Output
得分:100分
问题陈述
给你一个长度为N的整数序列A和整数K和X。
打印通过在序列A的第K个元素之后立即插入整数X获得的整数序列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获得的整数序列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