Problem: Ivan plays some computer game. There are n quests in the game. Each quest can be upgraded once, this increases the reward for its completion. Each quest has 3 parameters a_{i}, b_{i}, p_{i}: reward for completing quest before upgrade, reward for completing quest after upgrade (a_{i} < b_{i}) and probability of successful completing the quest.

Each second Ivan can try to complete one quest and he will succeed with probability p_{i}. In case of success Ivan will get the reward and opportunity to upgrade any one quest (not necessary the one he just completed). In case of failure he gets nothing. Quests do not vanish after completing.

Ivan has t seconds. He wants to maximize expected value of his total gain after t seconds. Help him to calculate this value.

Input

First line contains 2 integers n ( 1 ≤ n ≤ 10^{5}) and t ( 1 ≤ t ≤ 10^{10}) — number of quests and total time.

Following n lines contain description of quests. Each description is 3 numbers a_{i} b_{i} p_{i} (1 ≤ a_{i} < b_{i} ≤ 10^{8}, 0 < p_{i} < 1) — reward for completing quest before upgrade, reward for completing quest after upgrade and probability of successful completing of quest. a_{i} and b_{i} are integers. All probabilities are given with at most 9 decimal places.

Output

Print the expected value.

Your answer will be accepted if absolute or relative error does not exceed 10^{-6}. Formally, let your answer be a, and the jury's answer be b. Your answer is considered correct if (|a-b|)/(max⁡(b,    1)) ≤ 10^{-6}.

Examples

Input

3 2
3 1000 0.5
1 2 0.48
3 20 0.3


Output

252.2500000000000


Input

2 2
1 1000 0.1
2 3 0.2


Output

20.7200000000000

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
const long long LL_INF = 1ll * INF * INF;
const int MAX_N = 100000 + 7;
template <typename T>
inline void addmod(T& a, const long long& b, const int& MOD = INF) {
  a = (a + b) % MOD;
  if (a < 0) a += MOD;
}
const long double oo = (long double)1e18;
struct LineHull {
  struct Line {
    long double a, b;
    Line(long double a, long double b) : a(a), b(b) {}
  };
  long double intersect(Line ln1, Line ln2) {
    return (long double)(ln2.b - ln1.b) / (ln1.a - ln2.a);
  }
  int bad(Line ln1, Line ln2, Line ln3) {
    return (long double)(ln1.a - ln2.a) * (ln2.b - ln3.b) >=
           (long double)(ln2.a - ln3.a) * (ln1.b - ln2.b);
  }
  vector<Line> hull;
  vector<long double> pos;
  LineHull() {
    pos.push_back(-oo);
    pos.push_back(+oo);
  }
  void add(long double a, long double b) {
    Line ln(a, b);
    pos.pop_back();
    while (hull.size() >= 2 &&
           bad(hull[hull.size() - 2], hull[hull.size() - 1], ln)) {
      hull.pop_back();
      pos.pop_back();
    }
    hull.push_back(ln);
    if (hull.size() >= 2)
      pos.push_back(intersect(hull[hull.size() - 2], hull[hull.size() - 1]));
    pos.push_back(+oo);
  }
  pair<long double, int> query(long double x) {
    if (!hull.size()) return {+oo, -1};
    int k = lower_bound(pos.begin(), pos.end(), x) - pos.begin() - 1;
    return {hull[k].a * x + hull[k].b, k};
  }
} lh;
int n;
long long max_t;
int a[MAX_N], b[MAX_N];
double p[MAX_N];
vector<pair<double, int>> line;
double read_p() {
  string s;
  cin >> s;
  double res = s[0] - '0';
  double k = 10;
  for (int i = 2; i < (int)(s).size(); ++i) {
    res = res + (s[i] - '0') / k;
    k *= 10;
  }
  return res;
}
long double calc(double f, double a, double best, long long len,
                 long long base = 0) {
  return ((a + best * (len + base)) * (1 - pow(1 - f, len))) +
         best * (len * pow(1 - f, len) + pow(1 - f, len) / f - 1 / f);
}
void solve() {
  cin >> n >> max_t;
  double best = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i] >> b[i];
    p[i] = read_p();
    best = max(best, b[i] * p[i]);
    line.push_back({p[i], a[i]});
  }
  sort(line.begin(), line.end());
  for (auto x : line) {
    lh.add(x.first, x.first * x.second);
  }
  long double res = 0;
  for (long long i = max_t; i > 0;) {
    auto tmp = lh.query(best * (max_t - i) - res);
    int k = tmp.second;
    double f = lh.hull[k].a;
    double a = lh.hull[k].b / f;
    long long lo = 1, hi = i, found = i;
    while (lo <= hi) {
      long long mid = (lo + hi) >> 1;
      long long len = i - mid + 1;
      long double prev =
          pow(1 - f, len - 1) * res + calc(f, a, best, len - 1, max_t - i);
      auto ans = lh.query(best * (max_t - mid) - prev);
      if (ans.second == k) {
        found = mid;
        hi = mid - 1;
      } else {
        lo = mid + 1;
      }
    }
    long long len = i - found + 1;
    res = pow(1 - f, len) * res + calc(f, a, best, len, max_t - i);
    i = found - 1;
  }
  cout << fixed << setprecision(6) << res << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  const bool multiple_test = false;
  int test = 1;
  if (multiple_test) cin >> test;
  for (int i = 0; i < test; ++i) {
    solve();
  }
}