You are given an array of n integers and a non-negative integer k. Rotate the array to the right by k positions: each element moves k slots toward the end, and elements that fall off the end wrap around to the front.
Because rotating by n returns the array to its original order, only k mod n matters. Print the array after the rotation.
Input format
Line 1: an integer n, the number of elements.
Line 2: an integer k, the number of right-rotation steps.
Line 3: n space-separated integers, the array (present whenever n >= 1).
Output format
One line: the n integers after rotation, space-separated, in their new left-to-right order.
Constraints
- 1 <= n <= 100000
- 0 <= k <= 1000000000
- -1000000000 <= each value <= 1000000000