#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;
	
	for(int i=0; i<n; i++){
		int sum = 0;
		
		for(int j=i; j<n; j++){
			sum += numbers[j];
			
			if(sum == k){
				int length = j - i + 1;
				
				if(length == largest)countLargest++;
				if(length == smallest)countSmallest++;
				
				if(length > largest){
					largest = length;
					countLargest = 1;
				}
				
				if(length < smallest){
					smallest = length;
					countSmallest = 1;
				}
				
				
			}
		}
	}
	
	cout<<largest<<" "<<countLargest<<endl;
	cout<<smallest<<" "<<countSmallest;
	
	return 0;
}