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;
using ll = long long;
const int N = 1e5;
ll n, t;
int a[N], b[N];
using D = double;
D p[N];
template <class T = long long, bool xIncreasing = false, class Comp = less<T> >
struct CHT {
  static T EPS;
  static Comp comp;

 private:
  using Line = pair<T, T>;

 public:
  vector<Line> lines;
  bool check(Line l1, Line l2, Line l3) {
    if (l2.first == l3.first) return 1;
    return (l2.first - l1.first) * (l3.second - l2.second) + EPS >=
           (l3.first - l2.first) * (l2.second - l1.second);
  }
  T f(int i, const T &x) { return lines[i].first * x + lines[i].second; }
  void add(const T &a, const T &b) {
    assert("add monotonic" && (lines.empty() || !comp(lines.back().first, a)));
    if (lines.size() && lines.back().first == a &&
        !comp(b, lines.back().second))
      return;
    while ((int)lines.size() >= 2 &&
           check(lines[lines.size() - 2], lines.back(), Line(a, b)))
      lines.pop_back();
    lines.emplace_back(a, b);
  }
  T query(const T &x) {
    Line p = get(x);
    return p.first * x + p.second;
  }
  pair<T, T> get(const T &x) {
    assert(lines.size());
    if (xIncreasing) {
      static size_t head = 0;
      if (head >= lines.size()) head = lines.size() - 1;
      while (head + 1 < lines.size() && comp(f(head + 1, x), f(head, x)))
        head++;
      return lines[head];
    } else {
      int ok = lines.size() - 1, ng = -1;
      while (ok - ng > 1) {
        int mid = (ok + ng) >> 1;
        if (comp(f(mid, x), f(mid + 1, x)))
          ok = mid;
        else
          ng = mid;
      }
      return lines[ok];
    }
  }
};
template <class T, bool xIncreasing, class Comp>
T CHT<T, xIncreasing, Comp>::EPS = 1e-19;
template <class T, bool xIncreasing, class Comp>
Comp CHT<T, xIncreasing, Comp>::comp;
template <class T>
vector<vector<T> > mult(vector<vector<T> > a, vector<vector<T> > b) {
  assert(a[0].size() == b.size());
  vector<vector<T> > res(a.size(), vector<T>(b[0].size(), 0));
  for (size_t i = 0; i < a.size(); i++) {
    for (size_t j = 0; j < b[0].size(); j++) {
      for (size_t k = 0; k < b.size(); k++) {
        res[i][j] += a[i][k] * b[k][j];
      }
    }
  }
  return res;
}
template <class T>
vector<vector<T> > makeE(int n) {
  vector<vector<T> > r(n, vector<T>(n, 0));
  for (int i = 0; i < n; i++) r[i][i] = T(1);
  return r;
}
template <class T>
vector<vector<T> > pow(vector<vector<T> > a, ll k) {
  assert(a.size() == a[0].size());
  vector<vector<T> > r = makeE<T>(a.size());
  while (k) {
    if (k & 1) r = mult(r, a);
    a = mult(a, a);
    k >>= 1;
  }
  return r;
}
using Vec = vector<D>;
using Mat = vector<Vec>;
int main() {
  std::ios::sync_with_stdio(false), std::cin.tie(0);
  cin >> n >> t;
  D m = 0;
  CHT<D, 0, greater<D> > cht;
  vector<pair<D, D> > ls;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i] >> p[i];
    m = max(m, b[i] * p[i]);
    ls.emplace_back(p[i], p[i] * a[i]);
  }
  sort(begin(ls), end(ls));
  for (auto &l : ls) cht.add(l.first, l.second);
  cout << fixed << setprecision(12);
  ll le = 1;
  Mat v{{cht.query(0)}, {1}, {1}};
  while (le != t) {
    D xle = m * le - v[0][0];
    auto g = cht.get(xle);
    ll f = t - le;
    ll h = 1;
    vector<Mat> mats;
    Mat A(3, Vec(3));
    A[0][0] = 1 - get<0>(g);
    A[0][1] = get<0>(g) * m;
    A[0][2] = get<1>(g);
    A[1][1] = A[1][2] = A[2][2] = 1;
    mats.push_back(A);
    while ((1ll << h) - 1 < f) {
      A = mult(A, A);
      mats.push_back(A);
      h++;
    }
    ll now = 0;
    for (int k = h - 1; k >= 0; k--) {
      ll j = 1ll << k;
      if (now + j > f) continue;
      auto tv = mult(mats[k], v);
      auto tdp = tv[0][0];
      ll tt = le + now + j;
      D x = m * tt - tdp;
      if (g == cht.get(x)) {
        v = tv;
        now += j;
      }
    }
    if (now + 1 <= f) {
      v = mult(mats[0], v);
      now++;
    }
    le += now;
  }
  cout << v[0][0] << endl;
  return 0;
}