import logging import sys from inspect import currentframe # 一つ前の配列だけ持っていれば十分 sys.setrecursionlimit(10 ** 6) input = sys.stdin.readline logging.basicConfig(level=logging.DEBUG) def dbg(*args): id2names = {id(v): k for k, v in currentframe().f_back.f_locals.items()} logging.debug( ", ".join(id2names.get(id(arg), "???") + " = " + repr(arg) for arg in args) ) def main(): INF = 10 ** 10 n, p = map(int, input().split()) dp = [[INF] * (p + 1) for _ in range(2)] dp[0][0] = 0 for i in range(n): l = list(map(int, input().split())) l.append(1) for k in range(4): for j in range(p + 1): if j + k <= p: dp[1][j + k] = min(dp[1][j + k], dp[0][j] + l[k]) # for j in range(p + 1): # dp[0][j] = dp[1][j] dp[0] = dp[1][:] dp[1] = [INF] * (p + 1) ans = dp[0][p] / n print(ans) if __name__ == "__main__": main()