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;
template <typename T>
void maxtt(T& t1, T t2) {
  t1 = max(t1, t2);
}
template <typename T>
void mintt(T& t1, T t2) {
  t1 = min(t1, t2);
}
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int& x, int y, int mod = 998244353) {
  assert(y >= 0);
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et(int x = -1) {
  printf("%d\n", x);
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 998244353) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) { return y ? gcd1(y, x % y) : x; }
long long T;
long double M;
struct mb {
  int a, b;
  long double p;
  void rd() {
    scanf("%d%d%Lf", &a, &b, &p);
    maxtt(M, p * b);
  }
  bool operator<(const mb& o) const { return p < o.p; }
} q[100035];
struct Line {
  long double a, b;
  long double get(long double x) { return a * x + b; }
};
struct ConvexHull {
  int size = 0, preQueryPos = 0;
  vector<Line> hull;
  ConvexHull() { size = 0; }
  void clear() {
    size = 0;
    preQueryPos = 0;
    hull.clear();
  }
  bool is_bad(int curr, int prev, int next) {
    Line c = hull[curr], p = hull[prev], n = hull[next];
    return (c.b - n.b) * (c.a - p.a) <= (p.b - c.b) * (n.a - c.a);
  }
  void add_line(long double a, long double b) {
    hull.push_back((Line){a, b});
    size++;
    while (size > 2 && is_bad(size - 2, size - 3, size - 1)) {
      hull[size - 2] = hull[size - 1];
      size--;
      hull.pop_back();
    }
  }
  long double query(long double x) {
    if (size == 0) return -(1LL << 60);
    int l = -1, r = size - 1;
    while (r - l > 1) {
      int m = (l + r) / 2;
      if (hull[m].get(x) <= hull[m + 1].get(x))
        l = m;
      else
        r = m;
    }
    long double z = hull[r].get(x);
    return z;
  }
  long double queryByOrder(long double x) {
    if (preQueryPos > size - 1)
      preQueryPos = size - 1;
    else {
      while (preQueryPos + 1 < size) {
        if (hull[preQueryPos].get(x) <= hull[preQueryPos + 1].get(x)) {
          preQueryPos++;
        } else
          break;
      }
    }
    return hull[preQueryPos].get(x);
  }
};
struct Matrix {
  int n, m;
  long double a[5][5];
  Matrix() {}
  Matrix(int n, int m) : n(n), m(m) {}
  void init(long long num) {
    for (int(i) = 0; (i) < (int)(n); (i)++)
      for (int(j) = 0; (j) < (int)(m); (j)++) a[i][j] = num;
  }
  Matrix operator*(Matrix b) {
    Matrix o = Matrix(n, b.m);
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < b.m; j++) {
        o.a[i][j] = 0;
        for (int k = 0; k < m; k++) {
          o.a[i][j] += a[i][k] * b.a[k][j];
        }
      }
    }
    return o;
  }
  Matrix pow(long long p) {
    Matrix o = Matrix(n, m);
    Matrix b = *this;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) o.a[i][j] = (i == j);
    while (p > 0) {
      if (p & 1) o = o * b;
      b = b * b;
      p >>= 1;
    }
    return o;
  }
} pw[40];
void fmain(int tid) {
  scanf("%d%lld", &n, &T);
  for (int(i) = 1; (i) <= (int)(n); (i)++) q[i].rd();
  sort(q + 1, q + 1 + n);
  ConvexHull ch = ConvexHull();
  for (int(i) = 1; (i) <= (int)(n); (i)++) ch.add_line(q[i].p, q[i].p * q[i].a);
  Matrix F = Matrix(3, 3);
  F.init(0);
  F.a[0][2] = 1;
  int cnt = 0, N = ch.hull.size();
  for (int(i) = 0; (i) < (int)(40); (i)++) pw[i] = Matrix(3, 3);
  for (long long i = 0; i < T;) {
    while (cnt + 1 < N) {
      long double x = -(F.a[0][0] - M * i);
      if (ch.hull[cnt].get(x) <= ch.hull[cnt + 1].get(x))
        cnt++;
      else
        break;
    }
    pw[0].init(0);
    pw[0].a[0][0] = 1 - ch.hull[cnt].a;
    pw[0].a[1][0] = ch.hull[cnt].a * M;
    pw[0].a[1][1] = 1;
    pw[0].a[2][0] = ch.hull[cnt].b;
    pw[0].a[2][1] = 1;
    pw[0].a[2][2] = 1;
    for (int(i) = 1; (i) <= (int)(35); (i)++) pw[i] = pw[i - 1] * pw[i - 1];
    for (int j = 33; ~j; j--) {
      if (i + (1LL << j) >= T) continue;
      Matrix G = F * pw[j];
      long double x = -(G.a[0][0] - M * (i + (1LL << j)));
      if (cnt == N - 1 || ch.hull[cnt].get(x) > ch.hull[cnt + 1].get(x)) {
        F = G;
        i += 1LL << j;
      }
    }
    ++i;
    F = F * pw[0];
  }
  printf("%.10Lf\n", F.a[0][0]);
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}