#include <bits/stdc++.h>
using namespace std;
const double INF = 1e9, eps = 1e-11;
int sgn(double a) { return a < eps ? -1 : a > eps; }
struct Pnt {
  double x, y;
  int id;
  Pnt(double xx = 0, double yy = 0, int ii = 0) {
    x = xx;
    y = yy;
    id = ii;
  }
  Pnt operator*(const double &d) const { return Pnt(x * d, y * d, id); }
  Pnt operator+(const Pnt &A) const { return Pnt(x + A.x, y + A.y, id); }
  Pnt operator-(const Pnt &A) const { return Pnt(x - A.x, y - A.y, id); }
  double operator^(const Pnt &A) const { return x * A.y - y * A.x; }
  bool operator<(const Pnt &A) const {
    int a = sgn(((*this) ^ A));
    return a ? a < 0 : (sgn(x - A.x) ? x < A.x : id < A.id);
  }
  bool ok() const { return y >= -eps; }
  double len() const { return sqrt(x * x + y * y); }
};
Pnt st;
set<Pnt> s;
double k[555555];
void chk() {
  Pnt ed, uv, vu;
  while (!st.ok()) {
    ed = st + (*s.begin());
    if (!ed.ok()) {
      st = ed;
      s.erase(s.begin());
    } else {
      uv = (*s.begin());
      s.erase(s.begin());
      vu = (Pnt(1, k[uv.id], uv.id) * (-st.y / k[uv.id]));
      s.insert(uv - vu);
      st = st + vu;
      break;
    }
  }
}
double query() { return st.x; }
void ins(Pnt ed, Pnt sg) {
  s.insert(sg);
  st = st + ed;
  chk();
}
void re(double &x) { scanf("%lf", &x); }
void pt(double x) { printf("%.12lf", x); }
int main() {
  double ls = 0;
  int n;
  cin >> n;
  double L;
  re(L);
  st.x = st.y = 0;
  int id = 0;
  s.insert(Pnt(INF, INF, 0));
  k[0] = 1;
  for (int i = 1; i <= n; ++i) {
    double x, y, s;
    re(x);
    re(y);
    re(s);
    double mnt = (x - ls) / 2;
    double mny = mnt - (x - ls);
    double mxt = INF;
    double mxy = INF - (x - ls);
    ++id;
    k[id] = 1;
    ins(Pnt(mnt, mny, id), Pnt(mxt - mnt, mxy - mny, id));
    mnt = (y - x) / (2 + s);
    mxt = (y - x) / s;
    mny = mnt * (s + 1) - (y - x);
    mxy = mxt * (s + 1) - (y - x);
    ++id;
    k[id] = (s + 1);
    ins(Pnt(mnt, mny, id), Pnt(mxt - mnt, mxy - mny, id));
    ls = y;
  }
  double x = L;
  double mnt = (x - ls) / 2;
  double mny = mnt - (x - ls);
  double mxt = INF;
  double mxy = INF - (x - ls);
  ++id;
  k[id] = 1;
  ins(Pnt(mnt, mny, id), Pnt(mxt - mnt, mxy - mny, id));
  pt(query());
  cout << endl;
  return 0;
}
