//#define NDEBUG #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; double fact(int n) { if (n <= 1) return 1; return fact(n-1)*n; } int d[55]; double dp[55][20000]; double solve() { int n, l; cin >> n >> l; for (int i = 0; i < n; i++) { int x, y; scanf("%d:%d", &x, &y); d[i] = x*60+y; } double res = 0; for (int i = 0; i < n; i++) { memset(dp, 0, sizeof(dp)); dp[0][0] = 1; for (int j = 0; j < n; j++) { if (i == j) continue; for (int u = 54; u >= 1; u--) { for (int k = 19000; k >= d[j]; k--) { dp[u][k] += dp[u-1][k-d[j]]; } } } for (int u = 0; u < 55; u++) { double p = 0; for (int k = 0; k < 60*l; k++) { p += dp[u][k]; } p *= fact(u)*fact(n-(u+1)); res += p; } } return res/fact(n); } int main() { printf("%.20f\n", solve()); return 0; }