Task
You are given an array with natural numbers, which is sorted in increasing order. The task is to find the subarray with a sum of at least that has the minimum difference between the maximum and minimum values in the subarray. If there are multiple such subarrays, find the one with the minimum length.
Input data
The first line contains two integers, and , representing the number of numbers in the array, and the sum we want to achieve.
The next line contains numbers sorted in increasing order, representing the values in the array.
Output data
The first line will contain two numbers, representing the minimum difference required and the minimum length of a subarray that meets the given property.
Constraints and clarifications
- A subarray represents values in the array of some consecutive indices.
- It is guaranteed that there is at least one subarray with a sum of at least .
Example 1
stdin
7 10
2 3 3 4 4 5 7
stdout
1 3
Explanation
The minimum difference is obtained if we take the subarray , the sum being , the difference between the maximum and minimum values being , and the minimum length being .
Example 2
stdin
15 85
1 5 6 7 7 7 8 8 9 9 11 13 15 16 17
stdout
7 10
Explanation