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 int gi() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + ch - 48;
    ch = getchar();
  }
  return x * f;
}
template <typename T>
inline bool Max(T &a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T>
inline bool Min(T &a, T b) {
  return b < a ? a = b, 1 : 0;
}
const int N = 1e5 + 7;
const double eps = 1e-12;
int n, len, tp, st[N];
long long t;
double a[N], b[N], p[N], M;
int dcmp(double x) {
  if (fabs(x) < eps) return 0;
  return x < 0 ? -1 : 1;
}
struct line {
  double k, b;
  int id;
  line() {}
  line(double k, double b, int id) : k(k), b(b), id(id) {}
  bool operator<(const line &rhs) const {
    if (dcmp(k - rhs.k) != 0) return dcmp(k - rhs.k) < 0;
    return dcmp(b - rhs.b) < 0;
  }
} l[N];
double X(int a, int b) { return (l[b].b - l[a].b) / (l[a].k - l[b].k); }
struct mat {
  double v[5][5];
  mat() { memset(v, 0, sizeof v); }
  void init() { memset(v, 0, sizeof v); }
  mat operator*(const mat &rhs) const {
    mat res;
    for (int i = 0; i <= 4; ++i)
      for (int j = 0; j <= 4; ++j)
        for (int k = 0; k <= 4; ++k) res.v[i][j] += v[i][k] * rhs.v[k][j];
    return res;
  }
} A, B[34], C;
mat Pow(mat a, long long b) {
  mat res;
  for (int i = 1; i <= 4; ++i) res.v[i][i] = 1;
  for (; b; b >>= 1, a = a * a)
    if (b & 1) res = res * a;
  return res;
}
int main() {
  scanf("%d%I64d\n", &n, &t);
  for (int i = 1; i <= n; ++i) {
    scanf("%lf%lf%lf", &a[i], &b[i], &p[i]);
    l[i] = line(p[i], p[i] * a[i], i);
    Max(M, b[i] * p[i]);
  }
  sort(l + 1, l + 1 + n);
  for (int i = 1; i <= n; ++i) {
    if (dcmp(l[i].k - l[i + 1].k) == 0) continue;
    l[++len] = l[i];
  }
  for (int i = 1; i <= len; ++i) {
    while (tp > 1 && dcmp(X(st[tp - 1], i) - X(st[tp], st[tp - 1])) <= 0) --tp;
    st[++tp] = i;
  }
  int now = 1;
  long long cnt = 0;
  for (int now = 1; now <= tp && cnt ^ t; ++now) {
    double R = cnt * M - A.v[1][1];
    if (now < tp && X(st[now], st[now + 1]) <= R) continue;
    int i = st[now];
    R = X(st[now], st[now + 1]);
    B[0].init();
    B[0].v[1][1] = 1 - l[i].k;
    B[0].v[2][1] = l[i].k;
    B[0].v[2][2] = B[0].v[3][1] = B[0].v[3][3] = B[0].v[4][2] = B[0].v[4][4] =
        1;
    A.v[1][3] = l[i].b, A.v[1][4] = M;
    for (int i = 1; i <= 33; ++i) B[i] = B[i - 1] * B[i - 1];
    for (int i = 33; ~i; --i)
      if (t - cnt > (1ll << i)) {
        C = A * B[i];
        if (now == tp || dcmp((cnt + (1ll << i)) * M - C.v[1][1] - R) < 0)
          A = C, cnt += (1ll << i);
      }
    cnt++, A = A * B[0];
  }
  printf("%.13lf\n", A.v[1][1]);
  return 0;
}