/** * @FileName a.cpp * @Author kanpurin * @Created 2020.06.05 01:46:34 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { int n,p;cin >> n >> p; vector dp(p+1,0); for (int i = 0; i < n; i++) { int a,b,c;cin >> a >> b >> c; for (int j = p; j >= 0; j--) { dp[j] = (dp[j] * i + a) / (i + 1); if (j - 1 >= 0) dp[j] = min(dp[j],(dp[j-1] * i + b) / (i + 1)); if (j - 2 >= 0) dp[j] = min(dp[j],(dp[j-2] * i + c) / (i + 1)); if (j - 3 >= 0) dp[j] = min(dp[j],(dp[j-3] * i + 1) / (i + 1)); } } printf("%.10f",dp[p]); return 0; }