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;
  }
  long long now = 0;
  double last_val = 0;
  B[0].v[1][0] = B[0].v[1][1] = B[0].v[2][0] = B[0].v[2][2] = B[0].v[3][2] =
      B[0].v[3][3] = 1;
  for (int i = 1; i <= tp && now ^ t; ++i) {
    double r = i == tp ? 1e100 : X(st[i], st[i + 1]);
    memset(A.v, 0, sizeof A.v);
    A.v[0][0] = last_val;
    A.v[0][1] = l[st[i]].b;
    A.v[0][2] = now * l[st[i]].k * M;
    A.v[0][3] = l[st[i]].k * M;
    B[0].v[0][0] = 1 - l[st[i]].k;
    if (now * M - A.v[0][0] > r) {
      continue;
    }
    for (int j = 1; j < 34; ++j) {
      B[j] = B[j - 1] * B[j - 1];
    }
    for (int j = 33; ~j; --j) {
      if (now + (1LL << j) >= t) {
        continue;
      }
      mat old = A;
      A = A * B[j];
      double x = (now + (1LL << j)) * M - A.v[0][0];
      if (x >= r) {
        A = old;
        continue;
      }
      now += 1LL << j;
    }
    ++now;
    A = A * B[0];
    last_val = A.v[0][0];
  }
  printf("%.15lf\n", last_val);
  return 0;
}