#include <bits/stdc++.h>
#define N 100001
using namespace std;
int n;
double pw,vw[N],pf[N],vf[N],th[N];
const double EPS = 1e-10;

double f(double x){
  double cost=x*pw;
  for(int i=0;i<n;i++){
    double v = th[i]-x*vw[i];
    if(v>0)cost+=pf[i]*(v/vf[i]);
  }
  return cost;
}

double search(){
  double L=0,R=101;
  while(abs(L-R)>EPS){
    double M1=(L+(R-L)/3);
    double M2=(L+2*(R-L)/3);
    if(f(M1)<f(M2))R=M2-EPS;
    else L=M1+EPS;
  }
  return L;
}


int main(){
  while(cin>>n,n){
    cin>>pw;
    for(int i=0;i<n;i++)scanf("%lf%lf%lf%lf",&vw[i],&pf[i],&vf[i],&th[i]);
    printf("%.10f\n",f(search()));
  }
  return 0;
}