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>
int n, k = 0;
long long m, t = 0;
std::pair<double, double> a[100002], V[100002];
double v[100002], maxx = 0, ans = 0, b[3], c[3];
struct matrix {
  double a[3][3];
  matrix() {
    a[0][0] = a[0][1] = a[0][2] = 0;
    a[1][0] = a[1][1] = a[1][2] = 0;
    a[2][0] = a[2][1] = a[2][2] = 0;
  }
  matrix operator*(matrix &p) {
    matrix t;
    t.a[0][0] = a[0][0] * p.a[0][0] + a[0][1] * p.a[1][0] + a[0][2] * p.a[2][0];
    t.a[0][1] = a[0][0] * p.a[0][1] + a[0][1] * p.a[1][1] + a[0][2] * p.a[2][1];
    t.a[0][2] = a[0][0] * p.a[0][2] + a[0][1] * p.a[1][2] + a[0][2] * p.a[2][2];
    t.a[1][0] = a[1][0] * p.a[0][0] + a[1][1] * p.a[1][0] + a[1][2] * p.a[2][0];
    t.a[1][1] = a[1][0] * p.a[0][1] + a[1][1] * p.a[1][1] + a[1][2] * p.a[2][1];
    t.a[1][2] = a[1][0] * p.a[0][2] + a[1][1] * p.a[1][2] + a[1][2] * p.a[2][2];
    t.a[2][0] = a[2][0] * p.a[0][0] + a[2][1] * p.a[1][0] + a[2][2] * p.a[2][0];
    t.a[2][1] = a[2][0] * p.a[0][1] + a[2][1] * p.a[1][1] + a[2][2] * p.a[2][1];
    t.a[2][2] = a[2][0] * p.a[0][2] + a[2][1] * p.a[1][2] + a[2][2] * p.a[2][2];
    return t;
  }
} g[36];
void calc(double a[3], matrix &p) {
  static double tmp[3];
  tmp[0] = a[0] * p.a[0][0] + a[1] * p.a[1][0] + a[2] * p.a[2][0];
  tmp[1] = a[0] * p.a[0][1] + a[1] * p.a[1][1] + a[2] * p.a[2][1];
  tmp[2] = a[0] * p.a[0][2] + a[1] * p.a[1][2] + a[2] * p.a[2][2];
  a[0] = tmp[0];
  a[1] = tmp[1];
  a[2] = tmp[2];
}
void init(double a, double b) {
  g[0] = matrix();
  g[0].a[0][0] = 1 - a;
  g[0].a[1][0] = maxx * a;
  g[0].a[1][1] = 1;
  g[0].a[2][0] = b;
  g[0].a[2][1] = 1;
  g[0].a[2][2] = 1;
  for (int i = 1; i <= 34; i++) g[i] = g[i - 1] * g[i - 1];
}
int main() {
  scanf("%d%lld", &n, &m);
  for (int i = 1; i <= n; i++) {
    int v, b;
    double P;
    scanf("%d%d%lf", &v, &b, &P);
    if (P * b >= maxx) maxx = P * b;
    a[i] = std::make_pair(P, P * v);
  }
  std::sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    while ((k && a[i].second >= V[k].second) ||
           (k > 1 &&
            (a[i].second - V[k].second) / (a[i].first - V[k].first) <
                (a[i].second - V[k - 1].second) / (a[i].first - V[k].first)))
      k--;
    V[++k] = a[i];
  }
  for (long long i = 1; i <= k; i++) {
    init(V[i].first, V[i].second);
    if (i != k) {
      double lim =
          (V[i + 1].second - V[i].second) / (V[i + 1].first - V[i].first);
      long long cnt = 0;
      b[0] = ans;
      b[1] = t;
      b[2] = 1;
      for (int i = 34; ~i; i--) {
        c[0] = b[0];
        c[1] = b[1];
        c[2] = b[2];
        calc(b, g[i]);
        if (lim > b[0] - b[1] * maxx)
          b[0] = c[0], b[1] = c[1], b[2] = c[2];
        else
          cnt += 1ll << i;
      }
      if (lim <= b[0] - b[1] * maxx) cnt++, calc(b, g[0]);
      if (t + cnt < m) {
        t += cnt;
        ans = b[0];
        continue;
      }
    }
    long long cnt = m - t;
    b[0] = ans;
    b[1] = t;
    b[2] = 1;
    for (int i = 34; ~i; i--)
      if (cnt >> i & 1) calc(b, g[i]);
    printf("%.6lf", b[0]);
    return 0;
  }
}