#include <bits/stdc++.h>
using namespace std;

int main() {
	int n,k;
	cin>>n>>k;
	
	vector<int> numbers(n);
	
	for(auto& number: numbers){
		cin>>number;
	}
	
	int smallest = INT_MAX, largest = INT_MIN;
	int countSmallest = 0, countLargest = 0;
	
	unordered_map<int,int> firstOccr, lastOccr;
	
	firstOccr[0] = -1;
	lastOccr[0] = -1;
	
	int currSum = 0;
	
	for(int i=0; i<n; i++){
		currSum += numbers[i];
		
		if(firstOccr.find(currSum - k) != firstOccr.end()){
			int minLen = i - lastOccr[currSum - k];
			int maxLen = i - firstOccr[currSum - k];
			
			if(maxLen == largest)countLargest++;
			if(minLen == smallest)countSmallest++;
			
			if(maxLen > largest){
				largest = maxLen;
				countLargest = 1;
			} 
			
			if(minLen < smallest){
				smallest = minLen;
				countSmallest = 1;
			} 
			
		}
		
		if(firstOccr.find(currSum) == firstOccr.end())firstOccr[currSum] = i;
		
		lastOccr[currSum] = i;
		
	}
	
	cout<<largest<<" "<<countLargest<<endl;
	cout<<smallest<<" "<<countSmallest;
	
	return 0;
}