#include <iostream>
#include <iomanip>
#include <vector>

using ldouble = long double;

struct Plant {
    ldouble vw, pf, vf, th;
};

bool solve() {
    int n;
    std::cin >> n;
    if (n == 0) return false;

    ldouble pw;
    std::cin >> pw;
    std::vector<Plant> ps(n);
    for (auto& p : ps) std::cin >> p.vw >> p.pf >> p.vf >> p.th;

    auto calc = [&](ldouble w) {
        ldouble ret = w * pw;
        for (auto p : ps) {
            ldouble need = p.th - p.vw * w;
            if (need > 0) ret += p.pf * need / p.vf;
        }
        return ret;
    };

    ldouble lw = 0, rw = 10000;

    for (int q = 0; q < 100; ++q) {
        ldouble llw = (lw * 2 + rw) / 3,
                rrw = (lw + rw * 2) / 3;

        if (calc(llw) < calc(rrw)) {
            rw = rrw;
        } else {
            lw = llw;
        }
    }

    std::cout << calc(lw) << "\n";
    return true;
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(10);

    while (solve()) {};

    return 0;
}

