#include <cstdio>
#include <algorithm>
using namespace std;

const int MAX_N = 100000;

int N;
double pw;
double vw[MAX_N], pf[MAX_N], vf[MAX_N], th[MAX_N];

double sumofcost(double w){
	double s = pw * w;
	for(int i = 0; i < N; i++){
		double f = (th[i] - w * vw[i]) * pf[i] / vf[i];
		s += max(0.0, f);
	}
	return s;
}

int main(){
	while(scanf("%d", &N) && N){
		scanf("%lf", &pw);
		for(int x = 0; x < N; x++){
			scanf("%lf%lf%lf%lf", vw+x, pf+x, vf+x, th+x);
		}
		double left = 0;
		double w1, w2;
		double right = 100;
		for(int n = 200; n--;){
			w1 = (2 * left + right) / 3;
			w2 = (left + 2 * right) / 3;
			if(sumofcost(w1) < sumofcost(w2)){
				right = w2;
			}else{
				left = w1;
			}
		}
		printf("%f\n", sumofcost(left));
	}
	return 0;
}