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;
template <typename A, typename B>
inline char smax(A &a, const B &b) {
  return a < b ? a = b, 1 : 0;
}
template <typename A, typename B>
inline char smin(A &a, const B &b) {
  return b < a ? a = b, 1 : 0;
}
template <typename I>
inline void read(I &x) {
  int f = 0, c;
  while (!isdigit(c = getchar())) c == '-' ? f = 1 : 0;
  x = c & 15;
  while (isdigit(c = getchar())) x = (x << 1) + (x << 3) + (c & 15);
  f ? x = -x : 0;
}
const int N = 1e5 + 7;
const int LOG = 36;
const double eps = 1e-13;
int n, nl;
long long t;
double M;
int a[N], b[N], q[N];
double p[N];
inline int dcmp(const double &x) {
  return fabs(x) < eps ? 0 : (x < 0 ? -1 : 1);
}
struct Line {
  double k, b;
  inline bool operator<(const Line &a) const {
    return dcmp(k - a.k) < 0 || (dcmp(k - a.k) == 0 && b < a.b);
  }
} l[N];
inline double crs(const Line &l1, const Line &l2) {
  return (l2.b - l1.b) / (l1.k - l2.k);
}
struct Matrix {
  double a[3][3];
  inline Matrix() { memset(a, 0, sizeof(a)); }
  inline Matrix(const double &x) {
    memset(a, 0, sizeof(a));
    a[0][0] = a[1][1] = a[2][2] = x;
  }
  inline void print() {
    for (int i = 0; i < 3; ++i) {
      for (int j = 0; j < 3; ++j) fprintf(stderr, "%.13lf ", a[i][j]);
      puts("");
    }
  }
  inline Matrix operator*(const Matrix &b) {
    Matrix c;
    c.a[0][0] = a[0][0] * b.a[0][0] + a[0][1] * b.a[1][0] + a[0][2] * b.a[2][0];
    c.a[0][1] = a[0][0] * b.a[0][1] + a[0][1] * b.a[1][1] + a[0][2] * b.a[2][1];
    c.a[0][2] = a[0][0] * b.a[0][2] + a[0][1] * b.a[1][2] + a[0][2] * b.a[2][2];
    c.a[1][0] = a[1][0] * b.a[0][0] + a[1][1] * b.a[1][0] + a[1][2] * b.a[2][0];
    c.a[1][1] = a[1][0] * b.a[0][1] + a[1][1] * b.a[1][1] + a[1][2] * b.a[2][1];
    c.a[1][2] = a[1][0] * b.a[0][2] + a[1][1] * b.a[1][2] + a[1][2] * b.a[2][2];
    c.a[2][0] = a[2][0] * b.a[0][0] + a[2][1] * b.a[1][0] + a[2][2] * b.a[2][0];
    c.a[2][1] = a[2][0] * b.a[0][1] + a[2][1] * b.a[1][1] + a[2][2] * b.a[2][1];
    c.a[2][2] = a[2][0] * b.a[0][2] + a[2][1] * b.a[1][2] + a[2][2] * b.a[2][2];
    return c;
  }
} f[LOG];
inline void ycl() {
  for (int i = 1; i <= n; ++i)
    smax(M, p[i] * b[i]), l[i] = (Line){p[i], p[i] * a[i]};
  sort(l + 1, l + n + 1);
  for (int i = 1; i <= n; ++i)
    if (dcmp(l[i].k - l[nl].k))
      l[++nl] = l[i];
    else
      l[nl] = l[i];
  n = nl, nl = 1;
  q[1] = 1;
  for (int i = 2; i <= n; ++i) {
    while (nl > 1 &&
           dcmp(crs(l[q[nl - 1]], l[i]) - crs(l[q[nl - 1]], l[q[nl]])) <= 0)
      --nl;
    q[++nl] = i;
  }
  for (int i = 1; i <= nl; ++i) l[i] = l[q[i]];
  n = nl;
}
inline void work() {
  ycl();
  double dp = 0;
  long long tt = 0;
  for (int i = 1; i <= n && tt < t; ++i) {
    double stp;
    if (i < n)
      stp = crs(l[i], l[i + 1]);
    else
      stp = 1e20;
    if (tt < t && dcmp(tt * M - dp - stp) >= 0) continue;
    Matrix A, B;
    A.a[0][0] = dp, A.a[1][0] = tt, A.a[2][0] = 1;
    B.a[0][0] = 1 - l[i].k, B.a[0][1] = l[i].k * M, B.a[0][2] = l[i].b;
    B.a[1][1] = 1, B.a[1][2] = 1;
    B.a[2][2] = 1;
    f[0] = B;
    for (int i = 1; i < LOG; ++i) f[i] = f[i - 1] * f[i - 1];
    for (int i = LOG - 1; ~i; --i)
      if (tt + (1ll << i) < t) {
        Matrix C = f[i] * A;
        if (dcmp(C.a[1][0] * M - C.a[0][0] - stp) < 0) A = C, tt += 1ll << i;
      }
    A = f[0] * A, ++tt;
    dp = A.a[0][0];
  }
  printf("%.13lf\n", dp);
}
inline void init() {
  read(n), read(t);
  for (int i = 1; i <= n; ++i) read(a[i]), read(b[i]), scanf("%lf", &p[i]);
}
int main() {
  init();
  work();
  fclose(stdin), fclose(stdout);
  return 0;
}