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

#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define dump(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define dump(x)
#endif

typedef long long int ll;
typedef pair<int,int> pii;
template<typename T> using vec=std::vector<T>;

const int inf=1<<30;
const long long int infll=1LL<<62;
const double eps=1e-9;
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){
    os << "[";
    for (const auto &v : vec) {
    	os << v << ",";
    }
    os << "]";
    return os;
}
double pw,vw[100000],pf[100000],vf[100000],th[100000];

void solve(int n){
    scanf("%lf",&pw);
    rep(i,0,n) scanf("%lf%lf%lf%lf",vw+i,pf+i,vf+i,th+i);

    vector<double> v={0};
    rep(i,0,n) if(vw[i]!=0 and th[i]/vw[i]>=0) v.push_back(th[i]/vw[i]);

    double ans=inf;
    for(double w:v){
        double d=w*pw;
        rep(i,0,n){
            if(d>=ans) break;
            d+=pf[i]*max(0.,(th[i]-w*vw[i])/vf[i]);
        }
        ans=min(ans,d);
    }
    printf("%f\n",ans);
}

int main(){
    while(true){
        int n;
        scanf("%d",&n);
        if(!n) break;
        solve(n);
    }
    return 0;
}