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;
template <class S, class T>
ostream& operator<<(ostream& o, const pair<S, T>& p) {
  return o << "(" << p.first << "," << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& vc) {
  o << "{";
  for (const T& v : vc) o << v << ",";
  o << "}";
  return o;
}
using ll = long long;
template <class T>
using V = vector<T>;
template <class T>
using VV = vector<vector<T>>;
struct CHT {
  using D = double;
  vector<pair<D, D>> deq;
  vector<int> id;
  int s, sd, t;
  int ID;
  CHT(int N) { init(N); }
  void init(int N) {
    id.resize(N);
    deq.resize(N);
    s = 0, sd = 0, t = 0;
    ID = 0;
  }
  void add(D a, D b) {
    a = -a, b = -b;
    pair<D, D> p(a, b);
    while (s + 1 < t && check(deq[t - 2], deq[t - 1], p)) t--;
    deq[t] = p;
    id[t] = ID++;
    t++;
  }
  pair<D, int> query(D x) {
    int lb = s - 1, ub = t - 1;
    while (ub - lb > 1) {
      int m = (lb + ub) / 2;
      if (isright(deq[m], deq[m + 1], x))
        lb = m;
      else
        ub = m;
    }
    return pair<D, int>(-f(deq[ub], x), id[ub]);
  }
  bool isright(pair<D, D>& a, pair<D, D>& b, D x) { return f(a, x) >= f(b, x); }
  bool check(pair<D, D>& a, pair<D, D>& b, pair<D, D>& c) {
    return (b.first - a.first) * (c.second - b.second) >=
           (b.second - a.second) * (c.first - b.first);
  }
  D f(pair<D, D>& p, int x) { return p.first * x + p.second; }
};
double Exp(double x, ll p) {
  double a = 1;
  while (p) {
    if (p & 1) a *= x;
    x *= x;
    p >>= 1;
  }
  return a;
}
int main() {
  int N;
  ll T;
  cin >> N >> T;
  struct Quest {
    double a, b, p;
  };
  V<Quest> qs;
  double QB = 0;
  for (int i = 0; i < (int)(N); i++) {
    double a, b, p;
    cin >> a >> b >> p;
    qs.push_back({a, b, p});
    QB = max(QB, p * b);
  }
  sort(qs.begin(), qs.end(),
       [&](const Quest& l, const Quest& r) { return l.p < r.p; });
  CHT cht(N);
  for (auto q : qs) {
    cht.add(q.p, q.p * q.a);
  }
  double d = 0;
  ll t = 0;
  while (true) {
    int who = cht.query(d).second;
    auto goNext = [&]() {
      double r = 1 - qs[who].p;
      double c = QB / qs[who].p - qs[who].a;
      V<double> exps;
      {
        for (int i = 0; i < (int)(60); i++) {
          if (t + (1LL << i) >= T) break;
          if (i == 0)
            exps.push_back(r);
          else
            exps.push_back(exps.back() * exps.back());
        }
      }
      int K = exps.size();
      for (int i = K - 1; i >= 0; i--) {
        if (t + (1LL << i) >= T) continue;
        double nd = (d - c) * exps[i] + c;
        if (cht.query(nd).second == who) d = nd, t += 1LL << i;
      }
      t++;
      d = (d - c) * r + c;
    };
    goNext();
    if (t == T) {
      printf("%.12f\n", T * QB - d);
      return 0;
    }
  }
}