#include <bits/stdc++.h>

using namespace std;

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

double f(double v)
{
  double ret = v * pw;
  for(int i = 0; i < N; i++) {
    ret += max(0.0, double(th[i] - vw[i] * v) / vf[i]) * pf[i];
  }
  return (ret);
}

int main()
{
  while(scanf("%d", &N), N) {
    scanf("%d", &pw);
    for(int i = 0; i < N; i++) {
      scanf("%d %d %d %d", vw + i, pf + i, vf + i, th + i);
    }
    double low = 0, high = 100;
    for(int i = 0; i < 100; i++) {
      double left = (low * 2 + high) / 3;
      double right = (low + high * 2) / 3;
      if(f(left) < f(right)) high = right;
      else low = left;
    }
    printf("%.10lf\n", f(low));
  }
}