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;
const long double is_eval = 1e50;
struct Line {
  long double m, b;
  mutable function<const Line*()> succ;
  bool operator<(const Line& rhs) const {
    if (rhs.b != is_eval) return m < rhs.m;
    const Line* s = succ();
    if (!s) return 0;
    long double x = rhs.m;
    return b - s->b < (s->m - m) * x;
  }
};
struct Cht : public multiset<Line> {
  bool bad(iterator y) {
    auto z = next(y);
    if (y == begin()) {
      if (z == end()) return 0;
      return y->m == z->m && y->b <= z->b;
    }
    auto x = prev(y);
    if (z == end()) return y->m == x->m && y->b <= x->b;
    return (x->b - y->b) * (z->m - y->m) >= (y->b - z->b) * (y->m - x->m);
  }
  void insert_line(long double m, long double b) {
    auto y = insert({m, b});
    y->succ = [=] { return next(y) == end() ? 0 : &*next(y); };
    if (bad(y)) {
      erase(y);
      return;
    }
    while (next(y) != end() && bad(next(y))) erase(next(y));
    while (y != begin() && bad(prev(y))) erase(prev(y));
  }
  long double eval(long double x) {
    auto l = *lower_bound((Line){x, is_eval});
    return l.m * x + l.b;
  }
};
Cht ma, mb;
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) {}
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 howlong(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 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;
    ma.insert_line(p[i], a[i] * p[i]);
    mb.insert_line(p[i], b[i] * p[i]);
    mx = max(mx, b[i] * p[i]);
  }
  for (auto x : ma) {
    lm[sz] = x.m, lb[sz] = x.b;
    sz++;
  }
  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 = howlong(q, id, x, ans);
  }
  printf("%.20lf\n", (double)ans);
}