#include using namespace std; typedef long long ll; const int MOD = 1000000007; const int MAX_N = 15010; const int INF = 1<<29; #define REP(i,n) for((i)=0;(i)<(int)(n);(i)++) int a[MAX_N][3]; int dp[MAX_N]; double ans; int main(){ int n, p; cin >> n >> p; for (int i = 0; i < n; i++) cin >> a[i][0] >> a[i][1] >> a[i][2]; for (int j = 0; j < MAX_N; j++) dp[j] = INF; dp[0] = 0; for(int i = 0; i < n; i++){ for (int j = p; j >= 0; j--){ dp[j] += a[i][0]; for (int k = 1; k < 3; k++){ if (j - k >= 0) dp[j] = min(dp[j], dp[j - k] + a[i][k]); } if (j - 3 >= 0) dp[j] = min(dp[j], dp[j - 3] + 1); } } ans = 1.0 * dp[p] / n; cout << ans << endl; return 0; }