#include <bits/stdc++.h>
const long double eps = 1e-10;
using namespace std;
int T, n, L;
double s;
long double ans = 0, nd, nw, sto;
map<long double, long double> R;
void add(int l, int r, long double v) {
  nd = (r - l) / (v + 1);
  R[v] += nd, ans += nd;
  if (v > 1) R[v] += (r - l) / (v - 1);
  while (nd > eps) {
    nw = R.rbegin()->first, sto = min(nd, R[nw]);
    R[nw] -= sto, nd -= sto;
    ans += sto / nw;
    if (R[nw] < eps) R.erase(nw);
  }
}
int main() {
  scanf("%d%d", &n, &L);
  for (int i = 1, l, r, lst = 0; i <= n; i++) {
    scanf("%d%d%lf", &l, &r, &s);
    add(lst, l, 1), add(l, r, s + 1), lst = r;
    if (i == n) add(r, L, 1);
  }
  printf("%.12lf\n", (double)ans);
}
