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 int N = 100005;
int n;
long long t;
long double a[N], b[N];
long double p[N];
long double mx;
long double lm[N], lb[N];
int sz;
void insert_line(long double _m, long double _b) {
  if (sz > 0 && _m == lm[sz - 1] && _b <= lb[sz - 1]) return;
  while (sz > 1) {
    if ((lb[sz - 2] - lb[sz - 1]) * (_m - lm[sz - 1]) >=
        (lb[sz - 1] - _b) * (lm[sz - 1] - lm[sz - 2]))
      sz--;
    else
      break;
  }
  if (sz == 1 && lm[0] == _m && lb[0] <= _b) sz--;
  lm[sz] = _m, lb[sz] = _b;
  sz++;
}
long double eval(long double x) {
  int L = 0, R = sz - 2, ans = sz - 1;
  while (L <= R) {
    int mid = (L + R) / 2;
    if (lb[mid] - lb[mid + 1] < (lm[mid + 1] - lm[mid]) * x)
      L = mid + 1;
    else
      R = mid - 1, ans = mid;
  }
  return lm[ans] * x + lb[ans];
}
void matmul(long double mans[3][3], long double mbase[3][3],
            long double tmp[3][3]) {
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++) {
      tmp[i][j] = 0;
      for (int k = 0; k < 3; k++) tmp[i][j] += mans[i][k] * mbase[k][j];
    }
}
long double save[34][3][3];
void prec(int id) {
  save[0][0][0] = 1;
  save[0][0][1] = lm[id];
  save[0][0][2] = lb[id];
  save[0][1][0] = 0;
  save[0][1][1] = 1 - lm[id];
  save[0][1][2] = mx - lb[id];
  save[0][2][0] = 0;
  save[0][2][1] = 0;
  save[0][2][2] = 1;
  for (int i = 1; i < 34; i++) matmul(save[i - 1], save[i - 1], save[i]);
}
long double push(long long &q, int id, long double x, long double ans) {
  long double xx;
  for (int j = 33; j >= 0; j--) {
    if (q + (1LL << j) > t) continue;
    xx = save[j][1][1] * x + save[j][1][2];
    if (id == sz - 1 || lb[id] - lb[id + 1] >= (lm[id + 1] - lm[id]) * xx) {
      q += (1LL << j);
      ans = save[j][0][0] * ans + save[j][0][1] * x + save[j][0][2];
      x = xx;
    }
  }
  return save[0][0][0] * ans + save[0][0][1] * x + save[0][0][2];
}
int sid[N];
int main() {
  scanf("%d %lld", &n, &t);
  for (int i = 0; i < n; i++) {
    double qq, ww, ee;
    scanf("%lf %lf %lf", &qq, &ww, &ee);
    a[i] = qq, b[i] = ww, p[i] = ee;
    sid[i] = i;
    mx = max(mx, b[i] * p[i]);
  }
  sort(sid, sid + n, [](int q, int w) {
    return make_pair(p[q], a[q] * p[q]) < make_pair(p[w], a[w] * p[w]);
    if (p[q] == p[w]) return a[q] * p[q] < a[w] * p[w];
    return p[q] < p[w];
  });
  for (int i = 0; i < n; i++) insert_line(p[sid[i]], a[sid[i]] * p[sid[i]]);
  long double ans = 0;
  int id = 0;
  for (long long q = 1; q <= t; q++) {
    long double x = mx * (long double)(q - 1) - ans;
    while (id + 1 < sz && lb[id] - lb[id + 1] < (lm[id + 1] - lm[id]) * x) id++;
    prec(id);
    ans = push(q, id, x, ans);
  }
  printf("%.20lf\n", (double)ans);
}