The Programmers

0

0 votes
Medium
Problem

N programmers are standing in a line. All of them have some skills given by Ai, where 1<=i<=N.

Their trainer can teach them and can increase their skills. At a time he can teach only one concept to one student. By learning a new concept, the skills of a programmer increase by 1.

The trainer can teach only P concepts to some students. He can teach multiple concepts to same student.

The trainer wants that most of the programmers should have the same skill level.


INPUT

First line contains number of test cases T.
First line of each test case contains two integers N and P, indicating number of Programmers and the maximum concepts that the trainer can teach, respectively.
Second line of each test case contains N space separated integers indicating the initial skills of the programmers.


OUTPUT

For each test case output two integers, the maximum number of programmers who can have the same skill level and the skill level reached by those programmers.

In case there are multiple skill levels reachable by maximizing the number of programmers, then choose the smaller skill level.


CONSTRAINTS

1<=T<=10
1<=N<=105
1<=Ai<=109
0<=P<=109

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

The trainer can teach 1 concept each to the programmer 2 and 5.
So the new skill levels are 4 3 3 3 3, therefore the answer is 4 3

Editor Image

?