#P1392B. Omkar and Infinity Clock
Omkar and Infinity Clock
Description
Being stuck at home, Ray became extremely bored. To pass time, he asks Lord Omkar to use his time bending power: Infinity Clock! However, Lord Omkar will only listen to mortals who can solve the following problem:
You are given an array of integers. You are also given an integer . Lord Omkar wants you to do operations with this array.
Define one operation as the following:
- Set to be the maximum value of your array.
- For every from to , replace with .
The goal is to predict the contents in the array after operations. Please help Ray determine what the final sequence will look like!
Each test contains multiple test cases. The first line contains the number of cases (). Description of the test cases follows.
The first line of each test case contains two integers and () – the length of your array and the number of operations to perform.
The second line of each test case contains integers – the initial contents of your array.
It is guaranteed that the sum of over all test cases does not exceed .
For each case, print the final version of array after operations described above.
Input
Each test contains multiple test cases. The first line contains the number of cases (). Description of the test cases follows.
The first line of each test case contains two integers and () – the length of your array and the number of operations to perform.
The second line of each test case contains integers – the initial contents of your array.
It is guaranteed that the sum of over all test cases does not exceed .
Output
For each case, print the final version of array after operations described above.
Samples
Note
In the first test case the array changes as follows:
Initially, the array is . .
After the operation, the array becomes .