#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>

using namespace std;

const int T = 86400;
const double EPS = 1e-8;
const int N = 3;

int n;
double m;
double data[T];

bool check(double d){
  double tmp[N];
  double sum = m;
  for(int j=0;j<N;j++){
    for(int i=0;i<T;i++){
      sum -= data[i];
      sum = min(sum + d, m);
      if(sum < 0.0 - EPS) return false;
    }
    tmp[j] = sum;
  }
  if(tmp[N-2] - EPS < tmp[N-1]) return true;
  return false;
}

int main(){
  while(cin >> n >> m && n){
    fill(data, data+T, 0.0);
    for(int i=0;i<n;i++){
      int s, t;
      double r;
      cin >> s >> t >> r;
      for(int j=s;j<t;j++) data[j] = r;
    }
    double l = 0.0;
    double r = 1e8;
    while(abs(l-r) >= EPS){
      double mid = (l + r) / 2.0;
      if(check(mid)) r = mid;
      else l = mid;
    }
    printf("%.7f\n", l);
  }
}