NOI Contest Archive

Archive / 2025 / Qualifier Round

Absolute Rotation

Medium · NOI 2025 Qualifier Round

You are given an array of n integers. You need to transform this array m times according to the following rule:

After applying this transformation m times, output the resulting array.

Input Format

The first line contains two integers ( n ) and ( m ) — the size of the array and the number of transformations.
The second line contains ( n ) space-separated integers representing the initial array.

Output Format

Print ( n ) space-separated integers — the array after performing the transformation ( m ) times.

Constraints

Sample Input 0

5 3  
4 7 2 9 5  

Sample Output 0

0 1 0 1 0