Array rotation - MarisaOJ: Marisa Online Judge

Array rotation

Time limit: 1000 ms
Memory limit: 256 MB
Given an array $A$ consisting of $n$ integers. Perform a left rotation of the array $k$ times and then print the resulting array. For example, given array $A = (1, 2, 3, 4, 5)$, after performing a left rotation $1$ time, it becomes $(2, 3, 4, 5, 1)$ (the first element moves to the end). ### Input - The first line contains two integers $n$ and $k$. - The second line contains $n$ integers $A_i$. ### Output - Print the array after performing a left rotation $k$ times. ### Constraints - $1 \le k \le n \le 100$. - $1 \le A_i \le 100$. ### Sample test ``` 5 2 1 2 3 4 5 ``` Output: ``` 3 4 5 1 2 ```