B. New Colony
time limit per test:2 seconds
memory limit per test:256 megabytes
input:standard input
output:standard output
After reaching your destination, you want to build a new colony on the new planet. Since this planet has many mountains and the colony must be built on a flat surface you decided to flatten the mountains using boulders (you are still dreaming so this makes sense to you).
You are given an array h1,h2,…,hn, where hi is the height of the i-th mountain, and k — the number of boulders you have.
You will start throwing boulders from the top of the first mountain one by one and they will roll as follows (let’s assume that the height of the current mountain is hi):
if hi≥hi+1, the boulder will roll to the next mountain;
if hi<hi+1, the boulder will stop rolling and increase the mountain height by 1 (hi=hi+1);
if the boulder reaches the last mountain it will fall to the waste collection system and disappear.
You want to find the position of the k-th boulder or determine that it will fall into the waste collection system.
Input
The first line contains a single integer t (1≤t≤100) — the number of
test cases.Each test case consists of two lines. The first line in each test case
contains two integers n and k (1≤n≤100; 1≤k≤109) — the number of
mountains and the number of boulders.The second line contains n integers h1,h2,…,hn (1≤hi≤100) — the height
of the mountains.It is guaranteed that the sum of n over all test cases does not exceed
100.
Output