#include<iostream>
#include<cmath>
#include<vector>
#include<cassert>
#include<iomanip>
#include<algorithm>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define EPS 1e-8
#define equals(a,b) (fabs((a)-(b)) < EPS) 
using namespace std;

struct P
{
  int s,t;
  long double u;
  P(int s=0,int t=0,long double u=0):s(s),t(t),u(u){}
}; 

int N;
long double L;


bool check(int *usage,long double volume)
{
  long double tank = L;
  vector<long double> dist;

  rep(j,2)
    {
      rep(i,86400)
	{
	  tank = min(L,tank+(volume-*(usage+i)));
	  if(tank <= EPS)return false;
	}
      dist.push_back(tank);
    }
  
  return dist[0] < dist[1]+EPS;
}

int main()
{
  while(cin >> N >> L,N|(int)L)
    {
      long double mincost = 0;
      P schedule[N];
      int usage[86401];
      rep(i,86400)usage[i] = 0;
      rep(i,N)
	{
	  cin >> schedule[i].s >> schedule[i].t >> schedule[i].u;
	  REP(j,schedule[i].s,schedule[i].t)
	    usage[j] = schedule[i].u;
	}
      
      long double l = 0;
      long double r = 1100000;
      long double mid;
      rep(j,100)
	{
	  mid = (l+r)/(long double)2.0;// in
	  if(!check(usage,mid))l = mid;
	  else       r = mid;	 
	}
	 
      cout << setiosflags(ios::fixed) << setprecision(8) << mid << endl;
    }
  return 0;
}