CHEF AND AUCTION
All submissions for this problem are available.
Our Chef is big fan of cricket and he is going to the auction of Kapil Dev's Bat. The auction committee will invite at max M bidders. There are total N bidders including Chef. The standard of each bidder is defined by the value of assets he posses. The Auction has an opening bid O, a bidder is invited only if his total value of assets is greater than or equal to the opening bid. You are given the values of assets of each bidder.
Please tell whether our Chef will be invited or not. If the Chef is invited output P, where P is the total number of bidders that are being invited, otherwise output -1.
The first line contains T, the number of testcase.
The first line of each testcase contain three space separated numbers N M O. Then the second line contain N space separated integers A1, A2, A3, ......., AN.
A1 is the value of assets, Chef possesses.
For each testcase output the required answer in a new line.
1 ≤ T ≤ 10 1 ≤ N ≤ 100000 1 ≤ M ≤ 100000 1 ≤ O ≤ 1000000000 1 ≤ Ai ≤ 1000000000
Input: 2 3 2 4 3 4 1 3 2 2 3 4 1 Output: -1 2
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions