#include<bits/stdc++.h>
using namespace std;

const int LOOP=100;
double solve(int n){
    double pw; cin>>pw;
    vector<double> vw(n),pf(n),vf(n),th(n);
    for(int i=0;i<n;i++) cin>>vw[i]>>pf[i]>>vf[i]>>th[i];
    
    auto calc=[&](double w){
        double res=w*pw;
        for(int i=0;i<n;i++){
            if(w*vw[i]>=th[i]) continue;
            else res+=(th[i]-w*vw[i])/vf[i]*pf[i];
        }
        return res;
    };
    double lb=0,ub=100;
    for(int loop=0;loop<LOOP;loop++){
        double midl=(lb*2+ub)/3;
        double midr=(lb+ub*2)/3;
        if(calc(midl)<calc(midr)) ub=midr;
        else lb=midl;
    }
    return calc(lb);
}
int main(){
    int n;
    cout<<setprecision(10)<<fixed;
    while(cin>>n,n){
        cout<<solve(n)<<endl;
    }
    
    return 0;
}
