Alice is celebrating the New Year with piles of candies! Each pile contains candies, and she defines her happiness factor as the minimum number of candies in any pile. As this is a special day, Alice wants to try to maximize her happiness factor by choosing exactly one pile and doubling the number of candies in it.
Find the following two values and print them as space-separated integers on a single line:
The maximum happiness factor Alice can achieve after doubling the number of candies in one of her piles.
The number of ways Alice can choose a pile to achieve the maximum happiness factor. In other words, this is the total number of piles that still result in the same maximum happiness factor if Alice chooses to double them.
Input Format
The first line contains an integer .
The second line contains space-separated integers describing .
Constraints
Output Format
Print the following two space-separated integers on a single line:
- The maximum happiness factor Alice can achieve after doubling the number of candies in one of her piles.
- The number of ways Alice can choose a pile to achieve the maximum happiness factor.
Sample Input 0
3
6 3 7
Sample Output 0
6 1
Explanation 0
Alice's candy piles initially look like this:
We then find the happiness factor (i.e., the minimum number of candies in any pile), which is . Alice chooses the second pile and doubles its candies:
After doubling the second pile, the happiness factor becomes ; this is maximal, because the happiness factor would've remained at if Alice had chosen any of the other piles to double. We then print the maximum happiness factor, , followed by the number of piles that result in that happiness factor when doubled, which is .
Sample Input 1
2
3 3
Sample Output 1
3 2
Explanation 1
We have two piles with three candies each, so our initial happiness factor is . No matter which pile Alice chooses to double, she will end up with one pile that has candies and one pile that has candies. This means the happiness factor will remain at regardless of which of the piles Alice chooses to double.
We then print the maximum happiness factor, , followed by the number of piles that result in that happiness factor when doubled, which is .