#include<iostream>
#include<algorithm>
using namespace std;
int n; long double l, u[86400];
bool solve(long double q) {
	long double T = l;
	for (int i = 0; i < 86400; i++) {
		T -= u[i % 86400]; T += q; if (T > l)T = l;
		if (T < 0)return false;
	}
	long double U = T;
	for (int i = 0; i < 86400; i++) {
		T -= u[i % 86400]; T += q; if (T > l)T = l;
		if (T < 0)return false;
	}
	if (T < U - 0.000001)return false;
	return true;
}
int main() {
	while (true) {
		cin >> n >> l; if (n == 0)break;
		for (int i = 0; i < 86400; i++)u[i] = 0;
		for (int i = 0; i < n; i++) {
			int s, t; long double v; cin >> s >> t >> v;
			for (int j = s; j < t; j++)u[j] = v;
		}
		long double L = 0, R = 1234567, M;
		for (int i = 0; i < 80; i++) {
			M = (L + R) / 2;
			if (solve(M) == true)R = M;
			else L = M;
		}
		printf("%.13Lf\n", M);
	}
	return 0;
}