#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main(){ int N,L; cin >> N >> L; int s[N]; int sum=0; for( int i = 0 ; i < N ; i++){ int a,b; scanf("%d:%d",&a,&b); s[i]=a*60+b; sum+=s[i]; } L*=60; if( sum <= L ){ printf("%.9f\n",(double)N); return 0; } double fact[N+1]; fact[0]=1; for( int i = 1; i <=N; i++) fact[i]=fact[i-1]*i; double dp[N+1][L+3600]; for( int i = 0 ; i <=N; i++ ) for( int j =0 ; j =0 ; k-- ){ for( int j = L+3599 ; j >=0; j-- ){ if(dp[k][j] != 0 ){ //cout << k+1 << ", "<< min(L+3599,j+s[i]) << endl; dp[k+1][min(L+3599,j+s[i])]+= dp[k][j]; } } } } double dp2[N+1][L+3600]; double ret =0; for( int i = 0 ; i < N ; i++ ){ for( int k = 0 ; k < N ; k++ ){ double tot = 0; for( int j = 0 ; j < L+3600; j++){ dp2[k][j]=dp[k][j]; if( k-1 >= 0 && j-s[i] >= 0 ){ dp2[k][j]-=dp2[k-1][j-s[i]]; } if( j < L && j+s[i] >= L && dp2[k][j] > 0){ //cout << s[i]<<", "<