You are given an array \(Arr_i\) of size N. You have to find the maximum value of K such that after choosing K numbers from the array the \(DiffValue\) of chosen numbers is less than or equal to S.
\(DiffValue\) for a set of integers is defined as the largest possible difference among any two integers of the set. However if you choose K numbers from the array, value of all the chosen numbers get multiplied by K.
Hence print two integers i.e the largest value of number K and largest possible \(DiffValue\) corresponding to value of K.
Input Format
First line contains T i.e number of testcases.
For each testcase,
First line contains two space separated integers denoting N and S and
The next line contains N space separated integers denoting the array.
Output Format
Print answer to each testcase in separate line.
For each testcase print two space separated integers denoting the value of K and \(DiffValue\).
Constraints
\(1<=T<=100\)
\(1<=N<=50000\)
\(1<=S<=1000000000\)
\(1<=Arr_i<=10000\)
For testcase 1 if we choose k=2 numbers i.e {1,2}. So the numbers get transformed into {1x2,2x2} = {2,4} giving the DiffValue=2 which is <= 3. Hence answer is 2 2.
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor