Problem1577--数组1--数组翻转

1577: 数组1--数组翻转

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 349  Solved: 281
[Status] [Submit] [Creator:]

Description

给定一个长度为 n 的数组a  和一个整数 k,请你编写一个函数

实现将数组a中的前 k 个数翻转。

输出翻转后的数组a 。


Input

第一行包含两个整数 n 和 k。1<=k<=n<=1000

第二行包含 n 个整数,表示数组a 。 1<=a[i]<=1000


Output

共一行,包含 n 个整数,表示翻转后的数组 

Sample Input Copy

5 3
1 2 3 4 5

Sample Output Copy

3 2 1 4 5

Source/Category

 提高B