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;
inline int cmp(long double x, long double y) {
  if (x == y) return 0;
  return (x < y) ? -1 : 1;
}
struct Point {
  long double x, y;
  Point() {}
  Point(long double a, long double b) : x(a), y(b) {}
  Point operator-(Point b) { return Point(x - b.x, y - b.y); }
  bool operator<(const Point &b) const {
    return (cmp(y, b.y) != 0) ? (cmp(y, b.y) > 0) : (cmp(x, b.x) > 0);
  }
};
long double cross(Point x, Point y) { return x.x * y.y - x.y * y.x; }
Point p[100005], hull[100005];
int st[100005];
int build(int n) {
  sort(p + 1, p + n + 1);
  int top = 0;
  for (int i = 1; i <= n; i++) {
    if (top && (p[i].y == p[st[top]].y || p[i].x < p[st[top]].x)) continue;
    while (top > 1 &&
           cmp(cross(p[i] - p[st[top]], p[st[top]] - p[st[top - 1]]), 0) <= 0)
      top--;
    st[++top] = i;
  }
  for (int i = 1; i <= top; i++) hull[i] = p[st[i]];
  return top;
}
struct Matrix {
  long double num[3][3];
  int n, m;
  Matrix() {}
  Matrix(int a, int b) : n(a), m(b) { memset(num, 0, sizeof(num)); }
};
Matrix operator*(Matrix &a, Matrix &b) {
  Matrix c(a.n, b.m);
  for (int i = 0; i < c.n; i++)
    for (int j = 0; j < c.m; j++)
      for (int k = 0; k < a.m; k++) c.num[i][j] += a.num[i][k] * b.num[k][j];
  return c;
}
long double maxn;
Matrix now[40];
void pre(int n, long double x, int y, long long t) {
  now[0] = Matrix(3, 3);
  now[0].num[0][0] = 1 - hull[y].x;
  now[0].num[0][1] = hull[y].x * maxn;
  now[0].num[0][2] = hull[y].y;
  now[0].num[1][1] = now[0].num[1][2] = now[0].num[2][2] = 1;
  for (int i = 1; i <= n; i++) now[i] = now[i - 1] * now[i - 1];
}
inline long double trans(long double x, int y, long long t) {
  return (1 - hull[y].x) * x + hull[y].y + hull[y].x * maxn * t;
}
int main() {
  int n;
  long long m;
  scanf("%d%lld", &n, &m);
  for (int i = 1; i <= n; i++) {
    long double x, y, z;
    scanf("%Lf%Lf%Lf", &x, &y, &z);
    p[i] = Point(z, x * z);
    maxn = max(maxn, y * z);
  }
  int k = build(n);
  long double ans = 0;
  int lx = 1;
  for (long long l = 1; l <= m; l++) {
    while (lx < k && cmp(trans(ans, lx, l - 1), trans(ans, lx + 1, l - 1)) <= 0)
      lx++;
    pre(34, ans, lx, l - 1);
    Matrix fir(3, 1);
    fir.num[0][0] = ans;
    fir.num[1][0] = l - 1;
    fir.num[2][0] = 1;
    for (int j = 34; j >= 0; j--)
      if (l + (1LL << j) <= m) {
        Matrix u = now[j] * fir;
        long double t = u.num[0][0];
        if (lx == k || cmp(trans(t, lx, l - 1 + (1LL << j)),
                           trans(t, lx + 1, l - 1 + (1LL << j))) >= 0) {
          l += (1LL << j);
          fir = u;
        }
      }
    fir = now[0] * fir;
    ans = fir.num[0][0];
  }
  printf("%.12Lf\n", ans);
  return 0;
}