#include "bits/stdc++.h" using namespace std; int getnum(char c){ return c - '0'; } double dp[51][36002]; double predp[51][36002]; double functional[51]; int S[51]; int main() { int N, L; cin >> N >> L; L *= 60; double ans = 0; int sum = 0; for (int i = 0; i < N; i++) { string temp; cin >> temp; int time = getnum(temp[0]) * 600 + getnum(temp[1]) * 60 + getnum(temp[3]) * 10 + getnum(temp[4]); if (time > L) time = L; S[i] = time; sum += time; } if (L >= sum){ cout << N << endl; return 0; } dp[0][0] = 1; for (int i = 0; i < N; i++) { for (int j = i; j >= 0; j--) { for (int k = 0; S[i] + k <= L * 2; k++) { if (!dp[j][k]) continue; dp[j + 1][S[i] + k] += dp[j][k]; } } } functional[0] = 1; for (int i = 1; i < 51; i++) { functional[i] = functional[i - 1] * i; } double sump = 0; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { for (int k = 0; k < L; k++) { predp[j][k] = dp[j][k]; if (j - 1 >= 0 && k - S[i] >= 0){ predp[j][k] -= predp[j - 1][k - S[i]]; } sump += predp[j][k] * functional[N - j - 1] * functional[j]; } } } sump /= functional[N]; ans += sump; printf("%.14f", ans); cin >> ans; }