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;
struct node {
  double a[3][3];
} T, A[100001], f[100001], E, C, TT, F[35], TTT;
int n, sta[100001], tp, x, y;
long long t, po[100001], ans;
double ma, P;
struct node2 {
  int a;
  double p;
} a[100001];
bool cmp(node2 a, node2 b) { return a.p < b.p; }
node cheng(node a, node b) {
  C.a[0][0] =
      b.a[0][0] * a.a[0][0] + b.a[0][1] * a.a[1][0] + b.a[0][2] * a.a[2][0];
  C.a[0][1] =
      b.a[0][0] * a.a[0][1] + b.a[0][1] * a.a[1][1] + b.a[0][2] * a.a[2][1];
  C.a[0][2] =
      b.a[0][0] * a.a[0][2] + b.a[0][1] * a.a[1][2] + b.a[0][2] * a.a[2][2];
  C.a[1][0] =
      b.a[1][0] * a.a[0][0] + b.a[1][1] * a.a[1][0] + b.a[1][2] * a.a[2][0];
  C.a[1][1] =
      b.a[1][0] * a.a[0][1] + b.a[1][1] * a.a[1][1] + b.a[1][2] * a.a[2][1];
  C.a[1][2] =
      b.a[1][0] * a.a[0][2] + b.a[1][1] * a.a[1][2] + b.a[1][2] * a.a[2][2];
  C.a[2][0] =
      b.a[2][0] * a.a[0][0] + b.a[2][1] * a.a[1][0] + b.a[2][2] * a.a[2][0];
  C.a[2][1] =
      b.a[2][0] * a.a[0][1] + b.a[2][1] * a.a[1][1] + b.a[2][2] * a.a[2][1];
  C.a[2][2] =
      b.a[2][0] * a.a[0][2] + b.a[2][1] * a.a[1][2] + b.a[2][2] * a.a[2][2];
  return C;
}
node quickmi(node a, long long b) {
  T = E;
  while (b) {
    if (b & 1) T = cheng(T, a);
    a = cheng(a, a);
    b >>= 1;
  }
  return T;
}
int main() {
  scanf("%d%I64d", &n, &t);
  ma = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%lf", &x, &y, &P);
    if (y * P > ma) ma = y * P;
    a[i].a = x;
    a[i].p = P;
  }
  memset(E.a, 0, sizeof(E.a));
  E.a[0][0] = E.a[1][1] = E.a[2][2] = 1;
  sort(a + 1, a + 1 + n, cmp);
  for (int i = 1; i <= n; i++) {
    memset(A[i].a, 0, sizeof(A[i].a));
    A[i].a[0][0] = 1 - a[i].p, A[i].a[0][1] = a[i].p * ma,
    A[i].a[0][2] = a[i].p * a[i].a;
    A[i].a[1][1] = A[i].a[1][2] = A[i].a[2][2] = 1;
  }
  tp = 0;
  for (int i = 1; i <= n; i++) {
    TT = cheng(f[tp], quickmi(A[sta[tp]], t - po[tp]));
    if (cheng(TT, A[sta[tp]]).a[0][2] > cheng(TT, A[i]).a[0][2]) continue;
    while (tp) {
      if (cheng(f[tp], A[sta[tp]]).a[0][2] < cheng(f[tp], A[i]).a[0][2]) {
        tp--;
        continue;
      }
      ans = -1;
      F[0] = A[sta[tp]];
      for (int j = 1; j < 35; j++) F[j] = cheng(F[j - 1], F[j - 1]);
      TT = f[tp];
      ans = po[tp];
      for (int j = 34; j >= 0; j--) {
        TTT = cheng(TT, F[j]);
        if (cheng(TTT, A[sta[tp]]).a[0][2] > cheng(TTT, A[i]).a[0][2])
          TT = TTT, ans += (1ll << j);
      }
      ans++;
      if (ans <= t)
        sta[++tp] = i, po[tp] = ans,
        f[tp] = cheng(f[tp - 1], quickmi(A[sta[tp - 1]], po[tp] - po[tp - 1]));
      break;
    }
    if (!tp) sta[++tp] = i, po[tp] = 1, f[tp] = E;
  }
  printf("%.10lf\n", cheng(f[tp], quickmi(A[sta[tp]], t - po[tp] + 1)).a[0][2]);
  return 0;
}