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>
const int N = 1e5 + 5;
const double eps = 1e-12;
using namespace std;
int n, a[N], b[N], id[N], l, r, q[N];
long long m;
double y[N], p[N], tmp[N], M;
struct Matrix {
  double a[4][4];
  Matrix() { memset(a, 0, sizeof(a)); }
  Matrix operator*(const Matrix &p) const {
    Matrix C;
    for (int i = 0; i <= 2; i++)
      for (int j = 0; j <= 2; j++)
        for (int k = 0; k <= 2; k++) C.a[i][j] += a[i][k] * p.a[k][j];
    return C;
  }
} ans, U[40];
template <typename T>
inline T read() {
  T x = 0, w = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') w = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * w;
}
double slope(int i, int j) { return (y[i] - y[j]) / (p[i] - p[j]); }
Matrix mul(Matrix x, Matrix y) {
  Matrix z;
  for (int i = 0; i <= 2; i++) tmp[i] = 0;
  for (int i = 0; i <= 2; i++)
    for (int j = 0; j <= 2; j++) tmp[i] += x.a[0][j] * y.a[j][i];
  for (int i = 0; i <= 2; i++) z.a[0][i] = tmp[i];
  return z;
}
Matrix build(int id) {
  Matrix res;
  res.a[0][0] = 1 - p[id], res.a[1][0] = M * p[id], res.a[2][0] = y[id];
  res.a[1][1] = res.a[2][1] = res.a[2][2] = 1;
  return res;
}
bool cmp(int a, int b) {
  return fabs(p[a] - p[b]) < eps ? y[a] > y[b] : p[a] < p[b];
}
int main() {
  n = read<int>(), m = read<long long>();
  for (int i = 1; i <= n; i++) {
    a[i] = read<int>(), b[i] = read<int>(), cin >> p[i];
    y[i] = p[i] * a[i], M = max(M, p[i] * b[i]), id[i] = i;
  }
  sort(id + 1, id + n + 1, cmp), l = 1, r = 0;
  for (int i = 1; i <= n; i++) {
    if (fabs(p[id[i]] - p[id[i - 1]]) < eps) continue;
    while (l < r && slope(id[i], q[r - 1]) > slope(q[r], q[r - 1])) r--;
    q[++r] = id[i];
  }
  ans.a[0][2] = 1;
  double cur_slp = 0;
  long long cur = 0;
  while (1) {
    while (l < r && y[q[l + 1]] - y[q[l]] >= -cur_slp * (p[q[l + 1]] - p[q[l]]))
      l++;
    Matrix G = build(q[l]);
    U[0] = G;
    for (int i = 1; i <= 34; i++) U[i] = U[i - 1] * U[i - 1];
    for (int i = 34; i >= 0; i--) {
      if (cur + (1ll << i) >= m) continue;
      Matrix tmp = mul(ans, U[i]);
      double slp = M * tmp.a[0][1] - tmp.a[0][0];
      if (l == r)
        cur += (1ll << i), ans = tmp;
      else if (y[q[l + 1]] - y[q[l]] < -slp * (p[q[l + 1]] - p[q[l]]))
        cur += (1ll << i), ans = tmp;
    }
    cur++, ans = mul(ans, U[0]), cur_slp = M * ans.a[0][1] - ans.a[0][0];
    if (cur == m) break;
  }
  cout << fixed << setprecision(8) << ans.a[0][0] << endl;
  return 0;
}