#include<bits/stdc++.h>
#define EPS (1e-8)
#define N 100005
using namespace std;
struct data{
  int vw,pf,vf,th;
};
int n,pw;
data d[N];
double ans;

double check(double f){
  double res=f*pw;
  for(int i=0;i<n;i++){
    if(d[i].th-d[i].vw*f<=0)continue;
    res+=(d[i].th-d[i].vw*f)/d[i].vf*d[i].pf;
  }
  ans=min(ans,res);
  return res;
}

void bynary_search(){
  double l=0,r=105;
  check(0);
  while(l+EPS<r){
    double m=(l+r)/2;
    if(check(m)>check(m+EPS))l=m+EPS;
    else r=m;
  }
}

int main(){
  while(1){
    cin>>n;
    if(!n)break;
    cin>>pw;
    for(int i=0;i<n;i++)
      scanf("%d%d%d%d",&d[i].vw,&d[i].pf,&d[i].vf,&d[i].th);
    ans=(1e9);
    bynary_search();
    printf("%.8f\n",ans);
  }
  return 0;
}