#include #include #include #include using namespace std; typedef long long ll; typedef pair P; const int INF = (int)1e9 + 1; int n, p; int dp[2][20010]; int score[5010][5]; int main(void) { cin >> n >> p; for (int i = 0; i < n; i++) { cin >> score[i][0] >> score[i][1] >> score[i][2]; score[i][3] = 1; } for (int i = 0; i < 2; i++) { for (int j = 0; j < 20010; j++) { dp[i][j] = INF; } } dp[0][0] = 0; for (int i = 0; i < n; i++) { for (int j = 0; j <= p; j++) { for (int k = 0; k < 3; k++) { if (j + k <= p) { dp[1][j + k] = min(dp[1][j + k], dp[0][j] + score[i][k]); } } } for (int j = 0; j <= p; j++) { dp[0][j] = dp[1][j]; dp[1][j] = INF; } } cout << fixed << setprecision(9) << (double)dp[0][p] / (double)n << endl; return 0; }