#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)

using namespace std;

double pw;
vector<double> vw, pf, vf, th;
double calc(double W) {
    int N = vw.size();
    double res = W * pw;

    REP(i, N) {
        double F = (th[i] - vw[i] * W) / vf[i];
        if(F > 0) {
            res += pf[i] * F;
        }
    }

    return res;
}

double find_min(double a, double b, double f(double)) {
    REP(_, 86) {
        double c = (a * 2 + b) / 3;
        double d = (a + b * 2) / 3;
        if(f(c) < f(d)) {
            b = d;
        } else {
            a = c;
        }
    }
    return (a + b) / 2;
}
static const double RATIO = (1 + sqrt(5.0)) * 0.5;
double find_min_fast(double left, double right, double f(double)){
	double leftValue = f((left * RATIO + right) / (1 + RATIO));
	double rightValue = f((left + right * RATIO) / (1 + RATIO));
	for (int loop = 0; loop < 72; ++loop){
		if (leftValue < rightValue){
			right = (left + right * RATIO) / (1 + RATIO);
			rightValue = leftValue;
			leftValue = f((left * RATIO + right) / (1 + RATIO));
		} else {
			left = (left * RATIO + right) / (1 + RATIO);
			leftValue = rightValue;
			rightValue = f((left + right * RATIO) / (1 + RATIO));
		}
	}
	if (leftValue < rightValue){
		right = (left + right * RATIO) / (1 + RATIO);
	} else {
		left = (left * RATIO + right) / (1 + RATIO);
	}
	return (right + left) * 0.5;
}

int main(){
    int N;
    while(cin >> N && N > 0) {
        cin >> pw;
        vw.resize(N);
        pf.resize(N);
        vf.resize(N);
        th.resize(N);
        REP(i, N) {
            cin >> vw[i] >> pf[i] >> vf[i] >> th[i];
        }

        /*
        double lb = 0, ub = 1000;
        REP(_, 100) {
            double left = (lb * 2 + ub) / 3;
            double right = (lb + ub * 2) / 3;
            if(calc(left) < calc(right)) {
                ub = right;
            } else {
                lb = left;
            }
        }
        */

        double x = find_min_fast(0, 1000, calc);

        printf("%.12lf\n", calc(x));
    }
    return 0;
}