#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
using namespace std;

typedef long long LL;

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(x) (x).begin(),(x).end()
const int IINF = 1e9;
const LL LINF = 1e18;
const LL MOD = 1e9+7;

int main() {
    LL N, C;
    cin >> N >> C;
    vector<LL> a(N), b(N), c(N);

    set<LL> zipped;


    LL M = -1;
    REP(i, N) {
        cin >> a[i] >> b[i] >> c[i];
        b[i]++;
        zipped.insert(a[i]);
        zipped.insert(b[i]);
    }

    map<LL, int> dic;
    map<int, LL> inv;
    int n = 0;
    for(auto i : zipped) {
        dic[i] = n;
        inv[n] = i;
        n++;
    }

    vector<LL> cost(dic.size() + 1, 0);
    REP(i, N) {
        cost[dic[a[i]]] += c[i];
        cost[dic[b[i]]] -= c[i];
    }

    FOR(i, 1, dic.size() + 1) {
        cost[i] += cost[i - 1];
    }
    REP(i, dic.size() + 1) {
        cost[i] = min(cost[i], C);
    }

    LL s = 0;
    REP(i, dic.size()) {
        s += (inv[i + 1] - inv[i])*cost[i];
    }
    cout << s << endl;


    return 0;
}

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

double dp[105][105][105];

int main() {
    ll A, B, C;
    cin >> A >> B >> C;

    for (int i = 0; i <= 100; i++) {
        for (int j = 0; j <= 100; j++) {
            for (int k = 0; k <= 100; k++) {
                dp[i][j][k] = 0;
            }
        }
    }
    dp[A][B][C] = 1;
    for (int i = A; i <= 100; i++) {
        for (int j = B; j <= 100; j++) {
            for (int k = C; k <= 100; k++) {
                if (i != A && j != 100 && k != 100) {
                    dp[i][j][k] += dp[i - 1][j][k] * (i - 1) / (i + j + k - 1);
                }
                if (j != B && k != 100 && i != 100) {
                    dp[i][j][k] += dp[i][j - 1][k] * (j - 1) / (i + j + k - 1);
                }
                if (k != C && i != 100 && j != 100) {
                    dp[i][j][k] += dp[i][j][k - 1] * (k - 1) / (i + j + k - 1);
                }
            }
        }
    }

    double ans = 0;
    rep(i, 100) rep(j, 100) {
        ans += dp[i][j][100] * (i + j + 100 - (A + B + C));
        ans += dp[i][100][j] * (i + j + 100 - (A + B + C));
        ans += dp[100][i][j] * (i + j + 100 - (A + B + C));
    }

    cout << fixed << setprecision(8) << ans << endl;

    // for (int i = 98; i <= 99; i++) {
    //     for (int j = 98; j <= 99; j++) cout << dp[100][i][j] << " ";
    //     cout << endl;
    // }
}