#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef _MSC_VER #include #endif #define FOR(i, a, b) for(int i = (a); i < (int)(b); ++i) #define rep(i, n) FOR(i, 0, n) #define ALL(v) v.begin(), v.end() #define REV(v) v.rbegin(), v.rend() #define MEMSET(v, s) memset(v, s, sizeof(v)) #define UNIQUE(v) (v).erase(unique(ALL(v)), (v).end()) #define MP make_pair #define MT make_tuple using namespace std; typedef long long ll; typedef long double ld; typedef pair P; ll dp[55][22000]; ll ans[55][22000]; ld fact[55]; int main(){ cin.tie(0); ios::sync_with_stdio(false); cout.setf(ios::fixed); cout.precision(20); fact[0] = 1; for (int i = 1; i < 55; ++i) fact[i] = fact[i - 1] * i; int n, L; cin >> n >> L; L *= 60; vector s(n); rep(i, n){ int a, b; char c; cin >> a >> c >> b; s[i] = a * 60 + b; } if (accumulate(ALL(s), 0) <= L){ cout << n << endl; } else{ //sort(ALL(s)); //ld x = 0; //ll cnt = 0; //ll ccnt[6] = {}; //do{ // ll sum = 0; // for (int i = 0; i <= s.size(); ++i){ // if (sum >= L){ // x += i; // ccnt[i]++; // break; // } // sum += s[i]; // } // ++cnt; //} while (next_permutation(ALL(s))); //cout << x / cnt << endl; //rep(i, 6){ // cout << "answer : " << ccnt[i] << endl; //} int MX = L + 3600; dp[0][0] = 1; for (int i = 0; i < n; ++i){ for (int j = i; j >= 0; --j){ rep(k, L + 3600){ dp[j + 1][min(k + s[i], MX)] += dp[j][k]; } } } ld ans = 0; for (int i = 0; i < n; ++i){ ld cnt = 0; for (int j = 1; j <= n; ++j){ ld tmp = 0; for (int k = max(s[i], L); k < L + s[i]; ++k){ tmp += dp[j - 1][k - s[i]]; } cnt += tmp*j*fact[j - 1] * fact[n - j]; } ans += cnt; } cout << ans / fact[n] - 1 << endl; } }