#abc278a. A - Shift

A - Shift

Score : 100100 points

问题描述

给定一个长度为 NN 的序列 A=(A1,A2,,AN)A = (A_1, A_2, \dots, A_N)

你需要执行以下操作恰好 KK 次:

  • 删除 AA 的首元素,并在 AA 的尾部添加一个 00

请输出经过这些操作后,AA 中的所有元素。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

You are given a sequence A=(A1,A2,,AN)A = (A_1, A_2, \dots, A_N) of length NN.
You perform the following operation exactly KK times:

  • remove the initial element of AA and append a 00 to the tail of AA.

Print all the elements of AA after the operations.

Constraints

  • 1N1001 \leq N \leq 100
  • 1K1001 \leq K \leq 100
  • 1Ai1001 \leq A_i \leq 100
  • All values in the input are integers.

Input

The input is given from Standard Input in the following format:

NN KK

A1A_1 A2A_2 \dots ANA_N

Output

Print the elements of AA after the operations in one line, separated by spaces.

Sample Input 1

3 2
2 7 8

Sample Output 1

8 0 0

Before the operations, A=(2,7,8)A = (2, 7, 8).
After performing the operation once, A=(7,8,0)A = (7, 8, 0).
After performing the operation twice, A=(8,0,0)A = (8, 0, 0).
Thus, (8,0,0)(8, 0, 0) is the answer.

Sample Input 2

3 4
9 9 9

Sample Output 2

0 0 0

Sample Input 3

9 5
1 2 3 4 5 6 7 8 9

Sample Output 3

6 7 8 9 0 0 0 0 0

update @ 2024/3/10 11:41:20