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 double eps = 1e-10;
int n;
double M = 0;
double f[65536 * 8];
struct pts {
  double x, y;
};
pts operator-(pts a, pts b) {
  a.x -= b.x, a.y -= b.y;
  return a;
}
double operator^(pts a, pts b) { return a.x * b.y - a.y * b.x; }
struct line {
  double k, b, a, p;
  void in() {
    double cb;
    scanf("%lf%lf%lf", &a, &cb, &p);
    M = max(M, cb * p);
    k = p, b = a * p;
  }
  double f(double x) { return k * x + b; }
} task[65536 * 8];
bool operator<(line a, line b) {
  if (fabs(a.k - b.k) < eps) return a.b > b.b;
  return a.k < b.k;
}
pts intersect(line a, line b) {
  double k1 = a.k, b1 = a.b, k2 = b.k, b2 = b.b;
  double x = (b2 - b1) / (k1 - k2), y = a.f(x);
  pts p;
  p.x = x, p.y = y;
  return p;
}
vector<line> conv;
bool chk(line l) {
  int cn = conv.size();
  pts p1 = intersect(conv[cn - 2], conv[cn - 1]),
      p2 = intersect(conv[cn - 2], l);
  return p1.x > p2.x;
}
struct mat {
  double a[3][3];
  double f(double x, double y, double z) {
    return x * a[0][0] + y * a[1][0] + z * a[2][0];
  }
} one;
mat operator*(mat a, mat b) {
  mat c;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      c.a[i][j] = 0;
      for (int k = 0; k < 3; k++) c.a[i][j] += a.a[i][k] * b.a[k][j];
    }
  }
  return c;
}
mat st[40];
int main() {
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++) one.a[i][j] = (i == j);
  int n;
  long long t;
  cin >> n >> t;
  for (int i = 1; i <= n; i++) task[i].in();
  sort(task + 1, task + n + 1);
  line bord;
  bord.k = -1e9, bord.b = -1e9;
  conv.push_back(bord);
  task[0].k = -1000;
  for (int i = 1; i <= n; i++) {
    if (fabs(task[i].k - task[i - 1].k) < eps) continue;
    while (conv.size() >= 2 and chk(task[i])) conv.pop_back();
    conv.push_back(task[i]);
  }
  for (int i = 0; i < conv.size(); i++) {
  }
  long long lst = 0;
  double lstf = 0;
  for (int i = 1; i < conv.size(); i++) {
    double pi = conv[i].p, ai = conv[i].a;
    mat cp;
    cp.a[0][0] = 1 - pi, cp.a[1][0] = M * pi, cp.a[2][0] = ai * pi;
    cp.a[0][1] = 0, cp.a[1][1] = 1, cp.a[2][1] = 1;
    cp.a[0][2] = 0, cp.a[1][2] = 0, cp.a[2][2] = 1;
    st[0] = cp;
    for (int j = 1; j <= 34; j++) st[j] = st[j - 1] * st[j - 1];
    int now = lst;
    cp = one;
    double a = lstf, b = lst, c = 1;
    double nxt;
    if (i < conv.size() - 1)
      nxt = intersect(conv[i], conv[i + 1]).x;
    else
      nxt = 4e18;
    for (int j = 34; j >= 0; j--) {
      if (lst + (1ll << j) <= t) {
        mat tmp = cp * st[j];
        if ((lst + (1ll << j)) * M - tmp.f(a, b, c) >= nxt) continue;
        lst += (1ll << j);
        cp = tmp;
      }
    }
    if (lst < t and lst * M - cp.f(a, b, c) < nxt) {
      cp = cp * st[0];
      lst++;
    }
    lstf = cp.f(a, b, c);
  }
  printf("%.12lf\n", lstf);
  return 0;
}