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 = 100054;
const double eps = 1e-13;
struct prob {
  int a, b;
  double p;
  prob *read() { return scanf("%d%d%lf", &a, &b, &p), this; }
  inline bool operator<(const prob &B) const { return b * p < B.b * B.p; }
} v[N];
struct vec2 {
  double x, y;
  vec2(double x0 = 0.0, double y0 = 0.0) : x(x0), y(y0) {}
  inline vec2 operator-(const vec2 &B) const { return vec2(x - B.x, y - B.y); }
  inline bool operator<(const vec2 &B) const {
    return x < B.x || (x == B.x && y < B.y);
  }
  inline double operator^(const vec2 &B) const { return x * B.y - y * B.x; }
} p[N], ch[N], *rt = ch;
int n, CH;
double M;
inline void up(double &x, const double y) { x < y ? x = y : 0; }
double trans(long long t, long long n, double a, double b, double f_t) {
  double ak = pow(1 - a, n), aq = (1 - ak) / a,
         ay = ((n - 1) + ak - (1 - a) * n) / (a * a);
  return ak * f_t + (aq * t + ay) * (a * M) + aq * b;
}
int main() {
  int i, j, k;
  long long t = 0, T;
  double cur = 0, next, slope, slope_limit;
  scanf("%d%lld", &n, &T);
  for (i = 0; i < n; ++i) v[i].read(), p[i] = vec2(v[i].p, v[i].p * v[i].a);
  {
    prob *it = std::max_element(v, v + n);
    M = it->b * it->p;
  }
  std::sort(p, p + n);
  for (i = 0; i < n; *rt++ = p[i++])
    for (; rt > ch + 1 && (((p[i]) - (rt[-2])) ^ ((rt[-1]) - (rt[-2]))) <= 0;
         --rt)
      ;
  CH = rt - ch;
  for (i = 0; i < CH - 1 && ch[i].y < ch[i + 1].y; ++i)
    ;
  for (; i < CH && t < T; ++i) {
    slope_limit =
        (i == CH - 1 ? INFINITY
                     : (ch[i].y - ch[i + 1].y) / (ch[i + 1].x - ch[i].x));
    slope = t * M - cur;
    if (slope > slope_limit) continue;
    for (j = 0;; ++j) {
      next = trans(t, 1ll << j, ch[i].x, ch[i].y, cur),
      slope = (t + (1ll << j)) * M - next;
      if (slope > slope_limit || t + (2ll << j) >= T) break;
    }
    for (k = j; k >= 0; --k) {
      if (t + (1ll << k) >= T) continue;
      next = trans(t, 1ll << k, ch[i].x, ch[i].y, cur),
      slope = (t + (1ll << k)) * M - next;
      if (slope <= slope_limit) t += 1ll << k, cur = next;
    }
    cur = (1 - ch[i].x) * cur + ch[i].x * M * t + ch[i].y, ++t;
  }
  printf("%.12lg\n", cur);
  return 0;
}