#include <bits/stdc++.h>
using namespace std;
int n, l, last;
double ans;
map<double, double> w;
void proc(int l, int r, double s) {
  int len = r - l;
  double energy = len / (s + 1);
  w[s] += energy;
  ans += energy;
  if (s > 1) w[s] += len / (s - 1);
  while (energy > 1e-9) {
    auto now = --w.end();
    double t = now->first, res = min(energy, w[t]);
    w[t] -= res;
    energy -= res;
    ans += res / t;
    if (w[t] < 1e-9) w.erase(now);
  }
}
int main() {
  scanf("%d%d", &n, &l);
  for (int i = 1; i <= n; ++i) {
    int l, r;
    double s;
    scanf("%d%d%lf", &l, &r, &s);
    proc(last, l, 1);
    proc(l, r, s + 1);
    last = r;
  }
  proc(last, l, 1);
  printf("%.10lf\n", ans);
}
