import sys
input = sys.stdin.readline

N,P=map(int,input().split())

DP=[1<<60]*(P+1)
DP[0]=0

for i in range(N):
    A=list(map(int,input().split()))
    A.append(1)
    NDP=[1<<60]*(P+1)

    for j in range(P+1):
        for k in range(4):
            if j+k<=P:
                NDP[j+k]=min(NDP[j+k],DP[j]+A[k])
    DP=NDP
        
print(DP[P]/N)