Point 5 Restaurant
All submissions for this problem are available.You have entered a magical Restaurant called “ Point 5. ” Here you have $N$ number of dishes ; each dish has a price. However, the rules of ordering the dishes is very unique. The rules are : 1.) You can order ONLY one dish. 2.) All the dishes with price less than or equal to the half of the price of the dish ordered, will automatically become free and will be placed on the table for you (including the one you had ordered). Let’s say you ordered dish $D$ with price $P$. You need to select $D$ in such a way that the you can eat maximum number of dishes but , you have to pay the minimum price. In other words , try to minimize $P$, but eat the maximum number of dishes. At the end , tell the number of dishes eaten and the corresponding $P$ . ###Input: - First line will contain $T$, number of testcases. - For each test case , first line contains $N$ , second line contains $N$ seperated integers that denote the price of the dishes. ###Output: For each testcase, output in a single line answer as stated above. ###Constraints - $1 \leq T \leq 1000$ - $1 \leq N \leq 10^5$ - $1 \leq Price of Dishes \leq 10^8$ ###Sample Input: 2 5 16 26 12 64 10 4 12 14 50 60 ###Sample Output: 5 64 3 50 ###EXPLANATION: In the first testcase , if you choose P = 64 , you can eat all the dishes as half of 64 (64/2 = 32) , which is greater than all of the remaining dishes, which become free and served to you.
|Time Limit:||0.2 - 0.4 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, 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, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, COB, FS|
Fetching successful submissions