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 N = 1e5 + 7;
const long long INF = 1e18 + 7;
const double eps = 1e-10;
double p[N], vm[N];
long long a[N], b[N];
double maxn = 0;
long long n, m = 0, sz = 1, t;
struct fac {
  double k, b;
} f[N], dd[N], st[N];
bool cmp(fac x, fac y) { return x.k < y.k; }
double meet(fac u, fac v) { return (u.b - v.b) / (v.k - u.k); }
double ans[4][4], now[44][4][4], rp[4][4], cr3[4][4];
void cf(double cr0[4][4], double cr1[4][4], double cr2[4][4]) {
  for (int i = 1; i <= 3; i++) {
    for (int j = 1; j <= 3; j++) {
      cr3[i][j] = 0;
      for (int k = 1; k <= 3; k++) cr3[i][j] += cr1[i][k] * cr2[k][j];
    }
  }
  for (int i = 1; i <= 3; i++)
    for (int j = 1; j <= 3; j++) cr0[i][j] = cr3[i][j];
}
double check(double q, long long t, double p[4][4]) {
  return q * p[1][1] + t * p[1][2] + p[1][3];
}
void work(fac v, long long &nw, double &dp, double R) {
  if (nw == t) return;
  if (nw * maxn - dp >= R) return;
  now[0][1][1] = 1 - v.k;
  now[0][1][2] = v.k * maxn;
  now[0][1][3] = v.b;
  now[0][2][2] = now[0][2][3] = now[0][3][3] = 1;
  now[0][2][1] = now[0][3][1] = now[0][3][2] = 0;
  memset(ans, 0, sizeof(ans));
  long long i = 0, cs = 0;
  for (; maxn * ((1ll << i) + nw) - check(dp, nw, now[i]) <= R &&
         nw + (1ll << i) < t;
       i++)
    cf(now[i + 1], now[i], now[i]);
  for (int i = 1; i <= 3; i++) ans[i][i] = 1;
  for (; ~i; i--) {
    for (int j = 1; j <= 3; j++)
      for (int k = 1; k <= 3; k++) rp[j][k] = ans[j][k];
    cf(ans, ans, now[i]);
    if ((nw + cs + (1ll << i)) * maxn - check(dp, nw, ans) <= R &&
        nw + cs + (1ll << i) < t)
      cs += (1ll << i);
    else
      for (int j = 1; j <= 3; j++)
        for (int k = 1; k <= 3; k++) ans[j][k] = rp[j][k];
  }
  cf(ans, ans, now[0]);
  double an = dp * ans[1][1] + nw * ans[1][2] + ans[1][3];
  dp = an;
  nw += cs + 1;
}
int main() {
  scanf("%I64d%I64d", &n, &t);
  for (int i = 1; i <= n; i++) scanf("%I64d%I64d%lf", &a[i], &b[i], &p[i]);
  for (int i = 1; i <= n; i++) f[i] = (fac){p[i], p[i] * a[i]};
  for (int i = 1; i <= n; i++) maxn = max(maxn, b[i] * p[i]);
  sort(f + 1, f + n + 1, cmp);
  dd[++m] = f[1];
  for (int i = 2; i <= n; i++) {
    if (f[i].k > f[i - 1].k + eps || f[i].k < f[i - 1].k - eps)
      dd[++m] = f[i];
    else
      dd[m].b = max(dd[m].b, f[i].b);
  }
  for (int i = 1; i <= m; i++) f[i] = dd[i];
  st[1] = f[1];
  for (int i = 1; i <= m; i++) {
    while (sz > 1) {
      double r1 = meet(st[sz - 1], f[i]), r2 = meet(st[sz], f[i]);
      if (r1 < r2) break;
      sz--;
    }
    st[++sz] = f[i];
  }
  for (int i = 1; i <= sz - 1; i++) vm[i] = meet(st[i], st[i + 1]);
  vm[sz] = INF;
  long long nw = 0;
  double dp = 0;
  for (int i = 1; i <= sz; i++) work(st[i], nw, dp, vm[i]);
  printf("%.9lf\n", dp);
  return 0;
}