#include "bits/stdc++.h" #define rep(i,n) for(int i=0;i> N >> L; L *= 60; fact[0] = 1; for (int i = 1; i <= N; i++) fact[i] = fact[i - 1] * i; int sum = 0; rep(i, N) { int mm, ss; scanf("%d:%d", &mm, &ss); t[i] = mm * 60 + ss; sum += t[i]; } if (sum <= L) { cout << N << endl; return 0; } dp[0][0] = 1; rep(i, N) { for(int j=N-1;j>=0;j--) { for (int k = 0; k <= L; k++) { if (k - t[i] >= 0) dp[j + 1][k] += dp[j][k - t[i]]; } } } double ret = 0; rep(i, N) { rep(j, N) { for (int k = 0; k <= L-1; k++) { dp2[j][k] = dp[j][k]; if (j > 0 && k >= t[i]) dp2[j][k] -= dp2[j - 1][k - t[i]]; ret += dp2[j][k] * fact[j] * fact[N - 1 - j]; } } } cout << ret / fact[N] << endl; }