#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 10;
const double eps = 1e-8;
int n, tt, id[N];
double mx[N << 2], tag[N << 2], L, l[N], r[N], v[N], low[N], upp[N];
void mdf(int x, double v) { mx[x] += v, tag[x] += v; }
void pushdown(int x) {
  if (fabs(tag[x]) > eps)
    mdf((x << 1), tag[x]), mdf((x << 1 | 1), tag[x]), tag[x] = 0;
}
void modify(int L, int R, double v, int x = 1, int l = 1, int r = tt) {
  if (L <= l && r <= R) return mdf(x, v);
  pushdown(x);
  int mid = (l + r) >> 1;
  if (L <= mid) modify(L, R, v, (x << 1), l, mid);
  if (R > mid) modify(L, R, v, (x << 1 | 1), mid + 1, r);
  mx[x] = max(mx[(x << 1)], mx[(x << 1 | 1)]);
}
double query(int L, int R, int x = 1, int l = 1, int r = tt) {
  if (L <= l && r <= R) return mx[x];
  pushdown(x);
  int mid = (l + r) >> 1;
  double ret = -1e300;
  if (L <= mid) ret = max(ret, query(L, R, (x << 1), l, mid));
  if (R > mid) ret = max(ret, query(L, R, (x << 1 | 1), mid + 1, r));
  return ret;
}
bool cmp(int x, int y) { return v[x] < v[y]; }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> L;
  double lst = 0;
  for (int i = 1; i <= n; i++) {
    double _l, _r, _v;
    cin >> _l >> _r >> _v;
    if (_l > lst + eps) l[++tt] = lst, r[tt] = _l, v[tt] = 1;
    l[++tt] = _l, r[tt] = _r, v[tt] = _v + 1;
    lst = _r;
  }
  if (L > lst + eps) l[++tt] = lst, r[tt] = L, v[tt] = 1;
  for (int i = 1; i <= tt; i++) {
    if (v[i] < 1 + eps)
      low[i] = (r[i] - l[i]) / v[i];
    else
      low[i] = (r[i] - l[i]) / (v[i] - 1);
    upp[i] = (r[i] - l[i]) / (v[i] + 1);
    modify(i, tt, -low[i]);
    id[i] = i;
  }
  sort(id + 1, id + tt + 1, cmp);
  double ans = 0;
  for (int j = 1, i; i = id[j], j <= tt; j++) {
    double k = min(-query(i, tt), upp[i] + low[i]);
    ans += (r[i] - l[i] - (k - low[i])) / v[i];
    modify(i, tt, k);
  }
  cout << setprecision(10) << fixed << ans;
  return 0;
}
