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;
const double eps = 1e-14;
struct point {
  double x, y;
} g[100002];
struct Matrix {
  double a[4][4];
  long long n, m;
} ans, s[40];
Matrix operator*(Matrix a, Matrix b) {
  Matrix c;
  memset(c.a, 0, sizeof(c.a));
  c.n = a.n;
  c.m = b.m;
  for (long long i = 1; i <= a.n; i++) {
    for (long long j = 1; j <= b.m; j++) {
      for (long long k = 1; k <= a.m; k++) c.a[i][j] += a.a[i][k] * b.a[k][j];
    }
  }
  return c;
}
long long n, i, q[100002], head, tail;
long long t;
double p[100002], maxx, a[100002], b[100002];
long long my_comp(const point &a, const point &b) {
  if (fabs(a.x - b.x) < eps) return a.y > b.y;
  return a.x < b.x;
}
double calc(long long a, long long b) {
  return (g[a].y - g[b].y) / (g[a].x - g[b].x);
}
double get(double k, long long x) { return g[x].x * k + g[x].y; }
signed main() {
  scanf("%lld%lld", &n, &t);
  for (i = 1; i <= n; i++) {
    scanf("%lf%lf%lf", &a[i], &b[i], &p[i]);
    g[i].x = p[i], g[i].y = p[i] * a[i];
    maxx = max(maxx, p[i] * b[i]);
  }
  sort(g + 1, g + n + 1, my_comp);
  for (i = 1; i <= n; i++) {
    if (g[i].x - g[i - 1].x < eps) continue;
    while (tail - head > 1 &&
           calc(i, q[tail - 1]) - calc(q[tail - 1], q[tail - 2]) > eps)
      tail--;
    q[tail++] = i;
  }
  ans.n = 1;
  ans.m = 3;
  ans.a[1][3] = 1;
  for (i = 0; i <= 34; i++) s[i].n = s[i].m = 3;
  double k = 0;
  long long pos = 0;
  while (1) {
    while (tail - head > 1 && calc(q[head + 1], q[head]) > -k) head++;
    long long j = q[head];
    s[0].a[1][1] = 1 - g[j].x;
    s[0].a[2][1] = g[j].x * maxx;
    s[0].a[3][1] = g[j].y;
    s[0].a[2][2] = s[0].a[3][2] = s[0].a[3][3] = 1;
    for (i = 1; i <= 34; i++) s[i] = s[i - 1] * s[i - 1];
    for (i = 34; i >= 0; i--) {
      if (pos + (1LL << i) >= t) continue;
      Matrix tmp = ans * s[i];
      double k1 = maxx * tmp.a[1][2] - tmp.a[1][1];
      if (head == tail - 1 || get(k1, q[head]) > get(k1, q[head + 1])) {
        pos += (1LL << i);
        ans = tmp;
      }
    }
    ans = ans * s[0];
    pos++;
    k = maxx * ans.a[1][2] - ans.a[1][1];
    if (pos == t) break;
  }
  printf("%.8lf\n", ans.a[1][1]);
  return 0;
}