630. Rotate Array by K times

0

Medium

Satyam and Ayushi, two friends studying at Coding Blocks, are seeking assistance with a coding problem. They need help in solving the problem. You are given an array of size **N** and need to rotate the array to the right by **K** steps, where K is a non-negative integer.

Input Format

The first line contains two space-separated integers N and K.
The second line consists of an integer array.

Output Format

Print the Rotated Array

Example

Input

5 2 1 2 3 4 5

Output

4 5 1 2 3

Constraints

1 ≤ N ≤ 10^5 0 ≤ K ≤ 10^5 -2^31 ≤ Arr[i] ≤ 2^31
Loading...

View Submissions

Console