#include <bits/stdc++.h>
using namespace std;
int read() {
  int first = 0, f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = 0;
    c = getchar();
  }
  while (isdigit(c)) {
    first = (first * 10) + (c ^ 48);
    c = getchar();
  }
  return f ? first : -first;
}
const int maxn = 4e5 + 10;
struct heap {
  pair<long double, long double> buf[maxn];
  int top = 0;
  void push(pair<long double, long double> A) {
    buf[++top] = A;
    push_heap(buf + 1, buf + top + 1);
  }
  void pop() {
    pop_heap(buf + 1, buf + top + 1);
    --top;
  }
  pair<long double, long double> Top() { return buf[1]; }
} Q;
int first[maxn], second[maxn], tot;
pair<int, long double> p[maxn];
int main() {
  int n = read(), L = read();
  for (int i = 1; i <= n; ++i) {
    first[i] = read(), second[i] = read();
    long double z;
    scanf("%Lf", &z);
    z++;
    if (second[i - 1] < first[i])
      p[++tot] = make_pair(first[i] - second[i - 1], 1);
    p[++tot] = make_pair(second[i] - first[i], z);
  }
  if (second[n] < L) p[++tot] = make_pair(L - second[n], 1);
  long double ans = 0;
  for (int i = 1; i <= tot; ++i) {
    long double l = (p[i].second != 1) ? p[i].first / (1 - p[i].second) : 0,
                r = p[i].first / (1 + p[i].second);
    long double sum = 0;
    while (Q.top) {
      pair<long double, long double> u = Q.Top();
      if (u.first <= p[i].second) break;
      Q.pop();
      long double now = min(u.second, r - sum);
      u.second -= now;
      ans += now / u.first;
      ans -= now / p[i].second;
      sum += now;
      if (u.second != 0) Q.push(u);
      if (sum == r) break;
    }
    ans += p[i].first / p[i].second;
    Q.push(make_pair(p[i].second, sum - l));
  }
  printf("%.12Lf\n", ans);
  return 0;
}
