Array Rotation

Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 256M

Problem type

Array Rotation

Nick is just starting out his CS course at UWA. His first project involves going through a list of \(n\) numbers with the index corresponding to a clockwise rotation on a circle. Nick finds that if he at first rotates this mapping by \(k\) indices clockwise, his project is much more efficient. Help nick determine what this list would look like

Input Specification

The first line contains two integers \(n\) and \(k\) the next line will contain \(n\) space seperated integers \(a_1\) to \(a_n\)

Output Specification

Output \(n\) space seperated integers representing the resultant array


\(1 \leq n \leq 10^4\)
\(0 \leq k < n\)
\(-10^9 \leq a_i \leq 10^9\)

Sample Input

5 2
1 2 3 4 5

Sample Output

4 5 1 2 3


There are no comments at the moment.