import sys if sys.platform =='ios': import clipboard a=clipboard.get() a = a.split('\n') text = '\n'.join(a) with open('input_file.txt','w') as f: f.write(text) sys.stdin = open('input_file.txt') sys.setrecursionlimit(410000000) stdin = sys.stdin ni = lambda: int(ns()) ni_1 = lambda: int(ns())-1 na = lambda: list(map(int, stdin.readline().split())) ns = lambda: stdin.readline().strip() nm = lambda: map(int,input().split()) na_1 = lambda: list(map(lambda x:int(x)*(-1), stdin.readline().split())) na_2 = lambda: list(map(lambda x:int(x)-1, stdin.readline().split())) N,P = nm() ABC = [] for i in range(N): ABC.append(na()+[1]) INF = 10**10 dp = [[INF]*5001*3 for i in range(2)] dp[0][0] = 0 for i in range(N): for j in range(P+1): for k in range(4): if j+k <= P: dp[1][j+k] = min(dp[0][j]+ABC[i][k],dp[1][j+k]) for j in range(P+1): dp[0][j] = dp[1][j] dp[1][j] = INF print(dp[0][P]/N)