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 long long INF = 0x3f3f3f3f;
const int N = 2e5 + 10;
const long long mod = 998244353;
const long double Exp = 1e-12;
const bool debug = false;
struct M {
  long double v[3][3];
  int n;
  void init(long double p) {
    n = 3;
    v[0][0] = 1 - p;
    v[1][0] = p;
    v[1][1] = v[2][1] = v[2][2] = 1;
  }
  M operator*(M &it) const {
    M ret;
    ret.n = n;
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        ret.v[i][j] = 0.0;
        for (int k = 0; k < n; ++k) {
          ret.v[i][j] += v[i][k] * it.v[k][j];
        }
      }
    }
    return ret;
  }
} tp[40];
pair<long double, long double> node[N];
int line[N], en;
bool cmp(int k, int j, int i) {
  if (node[i].first - node[j].first < Exp) return true;
  return (node[j].first - node[k].first) * (node[j].second - node[i].second) <
         (node[i].first - node[j].first) * (node[k].second - node[j].second);
}
bool cmp2(int i, int j, long double x) {
  return x * (node[i].first - node[j].first) > node[j].second - node[i].second;
}
int main() {
  int n;
  long long t;
  scanf("%d%lld", &n, &t);
  long double mx = 0, ans = 0;
  for (int i = 1; i <= n; ++i) {
    int a, b;
    double p;
    scanf("%d%d%lf", &a, &b, &p);
    node[i] = {p, p * a};
    mx = max(mx, (long double)p * b);
  }
  sort(node + 1, node + n + 1);
  en = 0;
  for (int i = 1; i <= n; ++i) {
    ans = max(ans, t * node[i].second);
    while (en >= 2 && cmp(line[en - 1], line[en], i)) en--;
    while (en && node[i].first - node[line[en]].first < Exp) en--;
    line[++en] = i;
  }
  long double now = 0;
  long long now_t = 0;
  for (int i = 1, id, iid; i < en; ++i) {
    id = line[i], iid = line[i + 1];
    if (debug) {
      cout << i << " : " << node[id].first << " " << node[id].second << endl;
      cout << now << " " << now_t << endl;
      cout << (node[id].second - node[iid].second) /
                  (node[iid].first - node[id].first)
           << endl;
    }
    tp[0].init(node[id].first);
    for (int j = 1; j < 40; ++j) tp[j] = tp[j - 1] * tp[j - 1];
    for (int j = 35; j >= 0; --j) {
      if (now_t + (1ll << j) > t) continue;
      long long to_t = now_t + (1ll << j);
      long double to =
          tp[j].v[0][0] * now +
          tp[j].v[1][0] * (node[id].second / node[id].first + now_t * mx) +
          tp[j].v[2][0] * mx;
      if (!cmp2(iid, id, to_t * mx - to)) now = to, now_t = to_t;
    }
    if (!cmp2(iid, id, now_t * mx - now) && now_t < t)
      now = tp[0].v[0][0] * now +
            tp[0].v[1][0] * (node[id].second / node[id].first + now_t * mx),
      now_t++;
    if (debug) {
      cout << now << " " << now_t << endl;
    }
  }
  en = line[en];
  if (debug) {
    cout << now_t << endl;
    cout << en << " : " << node[en].first << " " << node[en].second << endl;
  }
  tp[0].init(node[en].first);
  for (int j = 1; j < 40; ++j) tp[j] = tp[j - 1] * tp[j - 1];
  for (int j = 35; j >= 0; --j) {
    if (now_t + (1ll << j) > t) continue;
    now = tp[j].v[0][0] * now +
          tp[j].v[1][0] * (node[en].second / node[en].first + now_t * mx) +
          tp[j].v[2][0] * mx;
    now_t += (1ll << j);
  }
  ans = max(ans, now);
  printf("%.12Lf\n", ans);
  return 0;
}