using System;
using System.Collections.Generic;
using System.Linq;

namespace Test01
{
    class Program
    {
        const int INF = 1000000009;
        static void Main(string[] args)
        {
            int[] input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            int N = input[0];
            int P = input[1];

            int[,] c = new int[N + 1, 4];
            for(int i = 1; i <= N; i++)
            {
                input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
                for(int j = 0; j < 4; j++)
                {
                    if (j == 3) c[i, j] = 1;
                    else c[i, j] = input[j];
                }
            }
           
            double[,,] dp = new double[P + 1, N + 1, 4];          
            for(int p = 0; p <= P; p++)
            {
                for(int i = 0; i <= N; i++)
                {
                    for(int j = 0; j < 4; j++)
                    {
                        if (p < j) dp[p, i, j] = INF;
                    }
                }
            }

            //p問解いた
            for(int p = 0; p <= P; p++)
            {
                //i番目のコンテスト
                for(int i = 1; i <= N; i++)
                {
                    //i番目のコンテストでj解いた
                    for(int j = 0; j <= 3; j++)
                    {
                        if (p < j) continue;
                        double min = Math.Min(dp[p - j, i - 1, 0], dp[p - j, i - 1, 1]);
                        min = Math.Min(min, dp[p - j, i - 1, 2]);
                        min = Math.Min(min, dp[p - j, i - 1, 3]);
                        dp[p, i, j] = (min * (i - 1) + c[i, j]) / i;
                    }
                }
            }

            double ans;
            ans = Math.Min(dp[P, N, 0], dp[P, N, 1]);
            ans = Math.Min(ans, dp[P, N, 2]);
            ans = Math.Min(ans, dp[P, N, 3]);
            Console.WriteLine(ans);
        }
    }
}