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;
int n;
long long t;
struct hh {
  double a, b;
  bool operator<(hh x) const { return a < x.a; }
} sk[100005];
double w;
double jx[3][3], a[3];
void xc(double a[3], double b[3][3]) {
  double c[3];
  for (int i = 0; i < 3; ++i) c[i] = 0;
  for (int i = 0; i < 3; ++i)
    for (int j = 0; j < 3; ++j) c[j] += a[i] * b[i][j];
  for (int i = 0; i < 3; ++i) a[i] = c[i];
}
void Xc(double a[3][3], double b[3][3]) {
  double c[3][3];
  for (int i = 0; i < 3; ++i)
    for (int j = 0; j < 3; ++j) c[i][j] = 0;
  for (int i = 0; i < 3; ++i)
    for (int j = 0; j < 3; ++j)
      for (int k = 0; k < 3; ++k) c[i][k] += a[i][j] * b[j][k];
  for (int i = 0; i < 3; ++i)
    for (int j = 0; j < 3; ++j) a[i][j] = c[i][j];
}
double query(long long s, long long t, double ans, int p) {
  if (t == s) return ans;
  jx[0][0] = 1 - sk[p].a;
  jx[0][1] = jx[0][2] = 0;
  jx[1][0] = w * sk[p].a;
  jx[1][1] = 1;
  jx[1][2] = 0;
  jx[2][0] = sk[p].b;
  jx[2][1] = jx[2][2] = 1;
  t -= s;
  a[0] = ans;
  a[1] = s;
  a[2] = 1;
  while (t) {
    if (t & 1) xc(a, jx);
    Xc(jx, jx);
    t >>= 1;
  }
  return a[0];
}
int main() {
  scanf("%d%lld", &n, &t);
  for (int i = 1; i <= n; ++i) {
    double a, b, c;
    scanf("%lf%lf%lf", &a, &b, &c);
    w = max(w, b * c);
    sk[i].a = c;
    sk[i].b = a * c;
  }
  sort(sk + 1, sk + n + 1);
  int r = 0;
  for (int i = 1; i <= n; ++i) {
    while (r > 1 && (sk[i].b - sk[r].b) * (sk[r].a - sk[r - 1].a) >=
                        (sk[r].b - sk[r - 1].b) * (sk[i].a - sk[r].a))
      --r;
    sk[++r] = sk[i];
  }
  long long tp = 0;
  double ans = 0;
  int pr = 1;
  while (tp < t && pr < r) {
    long long L = tp + 1, R = t, s1 = tp;
    double s2 = ans;
    while (L <= R) {
      long long mid = (L + R) >> 1;
      double w1 = query(tp, mid - 1, ans, pr), w2 = w1;
      w1 += ((mid - 1) * w - w1) * sk[pr].a + sk[pr].b;
      w2 += ((mid - 1) * w - w2) * sk[pr + 1].a + sk[pr + 1].b;
      if (w1 >= w2)
        L = mid + 1, s1 = mid, s2 = w1;
      else
        R = mid - 1;
    }
    ++pr;
    tp = s1;
    ans = s2;
  }
  printf("%.13lf\n", query(tp, t, ans, pr));
}