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

typedef pair<double,double> P;

#define repl(i,a,b) for(int (i)=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define dbg(x) cout<<#x<<"="<<x<<endl

#define EPS 1e-6

struct line{
  double wi,ai,bi;
  int typ;
};
bool operator<(const line& a,const line& b){
  return a.wi < b.wi;
}

int N;
int pw;
int vw[100010],pf[100010],vf[100010],th[100010];

int main(){
  while(1){
    cin>>N;
    if(N==0)break;
    cin>>pw;
    rep(i,N)cin>>vw[i]>>pf[i]>>vf[i]>>th[i];

    double a=0,b=0;
    vector<line> ls;
    rep(i,N){

      double ai=-(double)pf[i]*((double)vw[i]/(double)vf[i]);
      double bi=(double)pf[i]*((double)th[i]/(double)vf[i]);
      
      if(ai>EPS){ // pos
        double wi=-bi/ai;
        if(wi>EPS){
          ls.push_back((line){wi,ai,bi,+1});
        }else{
          a+=ai;
          b+=bi;
        }
      }else if(ai<-EPS){ // neg
        double wi=-bi/ai;
        if(wi>EPS){
          ls.push_back((line){wi,ai,bi,-1});
          a+=ai;
          b+=bi;
        }else{
      
        }
      }else{
        b+=max(0.0,bi);
      }
    }
    sort(all(ls));
    double res=b;
    rep(i,ls.size()){
      double crtw=ls[i].wi;
      res=min(res,crtw*((double)pw+a)+b);
      if(ls[i].typ==+1){
        a+=ls[i].ai;
        b+=ls[i].bi;
      }else{
        a-=ls[i].ai;
        b-=ls[i].bi;
      }
    }
    printf("%.10f\n", res);
  }

  return 0;
}

