#CCBCHBAHAI0000032. Dịch vòng trái (Left Rotation)
Dịch vòng trái (Left Rotation)
Dịch vòng trái (Left Rotation)
Source: HackerRank
Version: Phuoc Hung OJ Extended
Problem
Given an integer array and a non-negative integer .
One left rotation by one position transforms
into
Perform left rotations. Define
Then the result satisfies
Print .
Input
The first line contains integers and . The second line contains integers .
Output
Print the array after left rotations on one line.
Subtask
Subtask 1 (100 points): ; ; .
Example
Input
5 4
1 2 3 4 5
Output
5 1 2 3 4
Explanation
Here . Thus , followed by .