{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eAfter 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).\u003c/p\u003e\u003ccenter\u003e \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/92cf884b0fb94649ec31cd02bc4d7829?v\u003d1715865908\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \u003c/center\u003e\u003cp\u003eYou are given an array $$$h_1, h_2, \\dots, h_n$$$, where $$$h_i$$$ is the height of the $$$i$$$-th mountain, and $$$k$$$\u0026nbsp;— the number of boulders you have.\u003c/p\u003e\u003cp\u003eYou will start throwing boulders from the top of the first mountain one by one and they will roll as follows (let\u0027s assume that the height of the current mountain is $$$h_i$$$): \u003c/p\u003e\u003cul\u003e \u003cli\u003e if $$$h_i \\ge h_{i + 1}$$$, the boulder will roll to the next mountain; \u003c/li\u003e\u003cli\u003e if $$$h_i \u0026lt; h_{i + 1}$$$, the boulder will stop rolling and increase the mountain height by $$$1$$$ ($$$h_i \u003d h_i + 1$$$); \u003c/li\u003e\u003cli\u003e if the boulder reaches the last mountain it will fall to the waste collection system and disappear. \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eYou want to find the position of the $$$k$$$-th boulder or determine that it will fall into the waste collection system.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains a single integer $$$t$$$ ($$$1 \\le t \\le 100$$$)\u0026nbsp;— the number of test cases.\u003c/p\u003e\u003cp\u003eEach test case consists of two lines. The first line in each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \\le n \\le 100$$$; $$$1 \\le k \\le 10^9$$$)\u0026nbsp;— the number of mountains and the number of boulders.\u003c/p\u003e\u003cp\u003eThe second line contains $$$n$$$ integers $$$h_1, h_2, \\dots, h_n$$$ ($$$1 \\le h_i \\le 100$$$)\u0026nbsp;— the height of the mountains.\u003c/p\u003e\u003cp\u003eIt is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$100$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, print $$$-1$$$ if the $$$k$$$-th boulder will fall into the collection system. Otherwise, print the position of the $$$k$$$-th boulder.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\n4 3\n4 1 2 3\n2 7\n1 8\n4 5\n4 1 2 3\n3 1\n5 3 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n1\n-1\n-1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eLet\u0027s simulate the first case:\u003c/p\u003e\u003cul\u003e \u003cli\u003e The first boulder starts at $$$i \u003d 1$$$; since $$$h_1 \\ge h_2$$$ it rolls to $$$i \u003d 2$$$ and stops there because $$$h_2 \u0026lt; h_3$$$. \u003c/li\u003e\u003cli\u003e The new heights are $$$[4,2,2,3]$$$. \u003c/li\u003e\u003cli\u003e The second boulder starts at $$$i \u003d 1$$$; since $$$h_1 \\ge h_2$$$ the boulder rolls to $$$i \u003d 2$$$; since $$$h_2 \\ge h_3$$$ the boulder rolls to $$$i \u003d 3$$$ and stops there because $$$h_3 \u0026lt; h_4$$$. \u003c/li\u003e\u003cli\u003e The new heights are $$$[4,2,3,3]$$$. \u003c/li\u003e\u003cli\u003e The third boulder starts at $$$i \u003d 1$$$; since $$$h_1 \\ge h_2$$$ it rolls to $$$i \u003d 2$$$ and stops there because $$$h_2 \u0026lt; h_3$$$. \u003c/li\u003e\u003cli\u003e The new heights are $$$[4,3,3,3]$$$. \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eThe positions where each boulder stopped are the following: $$$[2,3,2]$$$.\u003c/p\u003e\u003cp\u003eIn the second case, all $$$7$$$ boulders will stop right at the first mountain rising its height from $$$1$$$ to $$$8$$$.\u003c/p\u003e\u003cp\u003eThe third case is similar to the first one but now you\u0027ll throw $$$5$$$ boulders. The first three will roll in the same way as in the first test case. After that, mountain heights will be equal to $$$[4, 3, 3, 3]$$$, that\u0027s why the other two boulders will fall into the collection system.\u003c/p\u003e\u003cp\u003eIn the fourth case, the first and only boulders will fall straight into the collection system.\u003c/p\u003e"}}]}