#CCBCHBAHAI0000071. Dịch vòng trái d bước bằng mảng phụ (Left Rotate by d Using an Auxiliary Array)
Dịch vòng trái d bước bằng mảng phụ (Left Rotate by d Using an Auxiliary Array)
Left Rotate by d Using an Auxiliary Array (Dịch vòng trái d bước bằng mảng phụ)
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem
Given and a non-negative integer , normalize
After a left rotation by positions,
Construct using an auxiliary array and print it. The value may be much larger than .
Input
The first line contains and . The second line contains integers .
Output
Print the array after the left rotation.
Subtask
Subtask 1 (20 points): , , .
Subtask 2 (30 points): , , .
Subtask 3 (50 points): , , .
Example
Input
7 9
1 2 3 4 5 6 7
Output
3 4 5 6 7 1 2
Explanation
The sample follows the mathematical definition above.