#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1e8;
vi in;
double m;
double h;
bool check(){
	double L=m;
	double out[2];
	rep(q,2){
		loop(i,0,86400){
			L+=h-in[i];
			if(L<=0)return false;
			if(L>m)L=m;
		}
		out[q]=L;
	}
	if(abs(out[0]-out[1])<EPS)return true;
	return false;
}
int main(){
	int n;
	while(cin>>n>>m,n+m){
		in=vi(86401);
		while(n--){
			int a,b,c;
			cin>>a>>b>>c;
			b--;
			loop(i,a,b+1)in[i]=c;
		}
		double r=0,l=1e9;
		while(l-r>EPS){
			h=(r+l)/2;
			if(check())l=h;
			else r=h;
//			cout<<shosu(9)<<l<<" "<<r<<endl;
		}
		cout<<shosu(9)<<l<<endl;
//		cout<<endl;
	}
}