Processing math: 100%
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 Ai. ### Output - Print the array after performing a left rotation k times. ### Constraints - 1≤k≤n≤100. - 1≤Ai≤100. ### Sample test 5212345 Output: 34512