INF = 1e9 n,p = map(int,input().split()) dp = [[INF]*(p+1),[INF]*(p+1)] dp[0][p] = 0 for i in range(n): abc = list(map(int,input().split())) abc.append(1) for j in range(p+1): dp[(i+1)%2][j] = INF for j in range(p+1): for k in range(4): if j >= k: dp[(i+1)%2][j-k] = min(dp[(i+1)%2][j-k],dp[i%2][j] + abc[k]) print(dp[n%2][0]/n)