#include<bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define reps(i, s, n) for (int i = (s); i < (int)(n); ++i)
#define all(obj) begin(obj), end(obj)
#define cinv(a) rep(i,(int)a.size()) cin >> a[i] 
#define debug(a) rep(i,(int)a.size()) cout << a[i] << " "
#define pb push_back
#define eb emplace_back
typedef pair<int, int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;

template<typename T>
bool chmax(T& a, const T& b){if(a < b){a=b;return true;}return false;}
template<typename T>
bool chmin(T& a, const T& b){if(a > b){a=b;return true;}return false;}

int main() 
{
	ll n, C; cin >> n >> C;
	vector<pair<ll, ll>> p;
	rep(i, n)
	{
		ll a, b, c; cin >> a >> b >> c;
		p.eb(a, c);
		p.eb(b+1, -c);
	}
	sort(all(p));

	ll ans = 0;
	ll x = 0;
	ll y = 0;
	for (auto [i,j] : p)
	{
		ans += (i-x) * min(y, C);
		x = i;
		y += j;
	}
	cout << ans << endl;
}

#include <bits/stdc++.h>

#if MYDEBUG
#include "lib/cp_debug.hpp"
#else
#define DBG(...) ;
#endif
#if __cplusplus <= 201402L
template <typename T>
T gcd(T a, T b) { return ((a % b == 0) ? b : gcd(b, a % b)); }
template <typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }
#endif
using LL = long long;
constexpr LL LINF = 334ll << 53;
constexpr int INF = 15 << 26;
constexpr LL MOD = 1E9 + 7;

namespace Problem {
using namespace std;

class Solver {
 public:
  void solve() {
    int a, b, c;
    vector<vector<vector<double>>> memo(101, vector<vector<double>>(101, vector<double>(101, -1)));
    cin >> a >> b >> c;
    cout << calc(a, b, c, memo) << endl;
  }
  double calc(int a, int b, int c, vector<vector<vector<double>>> &memo) {
    if (a >= 100 || b >= 100 || c >= 100) {
      return 0;
    } else if (memo[a][b][c] >= 0) {
      return memo[a][b][c];
    } else {
      double ret = 1.0;
      ret += (double)(a) / (double)(a + b + c) * calc(a + 1, b, c, memo);
      ret += (double)(b) / (double)(a + b + c) * calc(a, b + 1, c, memo);
      ret += (double)(c) / (double)(a + b + c) * calc(a, b, c + 1, memo);
      return memo[a][b][c] = ret;
    }
  }
};

}  // namespace Problem

int main() {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(12);

  Problem::Solver sol;
  sol.solve();
  return 0;
}
