#include <bits/stdc++.h>
using namespace std;
const int N = 400005;
int n, m, cnt;
double Add[N], Need[N], pre[N];
struct Ask {
  int l, r, len, pos;
  double v;
} a[N];
int cmp(Ask x, Ask y) { return x.l < y.l; }
int cmp2(Ask x, Ask y) { return x.v < y.v; }
struct Tree {
  int l, r;
  double num, flag;
} T[N * 4];
void build(int x, int l, int r) {
  T[x].l = l;
  T[x].r = r;
  if (l == r) {
    T[x].num = pre[l];
    return;
  }
  int mid = (l + r) / 2;
  build(x * 2, l, mid);
  build(x * 2 + 1, mid + 1, r);
  T[x].num = min(T[x * 2].num, T[x * 2 + 1].num);
}
void down(int x) {
  T[x * 2].num += T[x].flag;
  T[x * 2 + 1].num += T[x].flag;
  T[x * 2].flag += T[x].flag;
  T[x * 2 + 1].flag += T[x].flag;
  T[x].flag = 0;
}
void insert(int x, int l, int r, double z) {
  if (T[x].l > r || l > T[x].r) return;
  if (T[x].l >= l && T[x].r <= r) {
    T[x].num += z;
    T[x].flag += z;
    return;
  }
  down(x);
  insert(x * 2, l, r, z);
  insert(x * 2 + 1, l, r, z);
  T[x].num = min(T[x * 2].num, T[x * 2 + 1].num);
}
double find(int x, int l, int r) {
  if (T[x].l > r || l > T[x].r) return 1e18;
  if (T[x].l >= l && T[x].r <= r) return T[x].num;
  down(x);
  return min(find(x * 2, l, r), find(x * 2 + 1, l, r));
}
int main() {
  scanf("%d%d", &n, &m);
  cnt = n;
  for (int i = 1; i <= n; i++)
    scanf("%d%d%lf", &a[i].l, &a[i].r, &a[i].v), a[i].len = a[i].r - a[i].l;
  for (int i = 1; i <= n; i++)
    if (a[i].l != a[i - 1].r)
      a[++cnt] = (Ask){a[i - 1].r, a[i].l, a[i].l - a[i - 1].r, 0, 0};
  if (a[n].r != m) a[++cnt] = (Ask){a[n].r, m, m - a[n].r, 0, 0};
  sort(a + 1, a + 1 + cnt, cmp);
  for (int i = 1; i <= cnt; i++) {
    if (a[i].v != 0) Add[i] = (double)a[i].len / a[i].v;
    Need[i] = (double)a[i].len / (a[i].v + 2);
    pre[i] = pre[i - 1] + Add[i], a[i].pos = i;
  }
  sort(a + 1, a + 1 + cnt, cmp2);
  build(1, 1, cnt);
  double ans = 0;
  for (int i = 1; i <= cnt; i++) {
    double tmp = min(find(1, a[i].pos, cnt), Need[a[i].pos] + Add[a[i].pos]);
    ans += (a[i].len - tmp + Add[a[i].pos]) / (a[i].v + 1);
    insert(1, a[i].pos, cnt, -tmp);
  }
  printf("%.12lf", ans);
}
