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;
inline void read(int &x) {
  int v = 0, f = 1;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-')
    f = -1;
  else
    v = (c & 15);
  while (isdigit(c = getchar())) v = (v << 1) + (v << 3) + (c & 15);
  x = v * f;
}
inline void read(long long &x) {
  long long v = 0ll, f = 1ll;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-')
    f = -1;
  else
    v = (c & 15);
  while (isdigit(c = getchar())) v = (v << 1) + (v << 3) + (c & 15);
  x = v * f;
}
inline void readc(char &x) {
  char c;
  while (((c = getchar()) == ' ') || c == '\n')
    ;
  x = c;
}
const long double eps = 0;
int n, i, j, k, l;
long long m;
long double mx;
struct mat {
  long double a[3][3];
} pw[35];
mat mul(mat x, mat y) {
  mat z;
  int i, j, k;
  for (((i)) = (0); ((i)) <= (((int)(3)) - 1); ((i))++)
    for (((j)) = (0); ((j)) <= (((int)(3)) - 1); ((j))++) {
      z.a[i][j] = 0;
      for (((k)) = (0); ((k)) <= (((int)(3)) - 1); ((k))++) {
        z.a[i][j] = z.a[i][j] + x.a[i][k] * y.a[k][j];
      }
    }
  return z;
}
struct _ {
  long double x, y;
  long double calc(long double t) { return y - x * t; }
} a[100005], stk[100005];
int tp;
_ operator-(_ x, _ y) { return (_){x.x - y.x, x.y - y.y}; }
long double crs(_ x, _ y) { return x.x * y.y - x.y * y.x; }
int ta[100005], tb[100005];
long double pp[100005], ans, f[3], g[3];
bool cmp(_ x, _ y) { return x.x < y.x; }
int main() {
  cin >> n >> m;
  for (((i)) = (1); ((i)) <= ((n)); ((i))++) {
    double a, b, p;
    cin >> a >> b >> p;
    ta[i] = a;
    tb[i] = b;
    pp[i] = p;
    mx = max(mx, tb[i] * pp[i]);
  }
  for (((i)) = (1); ((i)) <= ((n)); ((i))++) {
    a[i] = (_){pp[i], pp[i] * (ta[i] + m * mx)};
  }
  sort(a + 1, a + n + 1, cmp);
  for (((i)) = (1); ((i)) <= ((n)); ((i))++) {
    while (tp > 1 && crs(a[i] - stk[tp - 1], stk[tp] - stk[tp - 1]) <= eps)
      tp--;
    stk[++tp] = a[i];
  }
  i = 1;
  while (i <= tp) {
    f[0] = ans;
    f[1] = m;
    f[2] = 1;
    while (i < tp && stk[i].calc(f[0] + f[1] * mx) <
                         stk[i + 1].calc(f[0] + f[1] * mx) + eps)
      i++;
    pw[0].a[0][0] = 1 - stk[i].x;
    pw[0].a[1][1] = 1;
    pw[0].a[1][0] = -stk[i].x * mx;
    pw[0].a[2][0] = stk[i].y;
    pw[0].a[2][1] = -1;
    pw[0].a[2][2] = 1;
    for (((j)) = (1); ((j)) <= ((34)); ((j))++) {
      pw[j] = mul(pw[j - 1], pw[j - 1]);
    }
    for ((j) = (34); (j) >= (0); (j)--) {
      for (((k)) = (0); ((k)) <= (((int)(3)) - 1); ((k))++) g[k] = 0;
      for (((k)) = (0); ((k)) <= (((int)(3)) - 1); ((k))++)
        for (((l)) = (0); ((l)) <= (((int)(3)) - 1); ((l))++) {
          g[l] = (g[l] + f[k] * pw[j].a[k][l]);
        }
      if (g[1] > 0 &&
          (i == tp || stk[i].calc(g[0] + g[1] * mx) >
                          stk[i + 1].calc(g[0] + g[1] * mx) + eps)) {
        memcpy(f, g, sizeof(f));
      }
    }
    for (((k)) = (0); ((k)) <= (((int)(3)) - 1); ((k))++) g[k] = 0;
    for (((k)) = (0); ((k)) <= (((int)(3)) - 1); ((k))++)
      for (((l)) = (0); ((l)) <= (((int)(3)) - 1); ((l))++) {
        g[l] = (g[l] + f[k] * pw[0].a[k][l]);
      }
    memcpy(f, g, sizeof(f));
    ans = f[0];
    m = f[1];
    if (m == 0) break;
    i++;
  }
  printf("%.10f\n", double(ans));
  return 0;
}