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;
struct pdd {
  long double first, second;
  int id;
  pdd() {}
  pdd(long double first, long double second, int id)
      : first(first), second(second), id(id) {}
};
int n, a[100100], tp, b[100100];
long double mx, pi[101000];
pdd sta[101000], g[101000];
long long T;
long double cal1(long double p, long double T) {
  return (pow(p, T) - 1) / (p - 1);
}
long double cal2(long double p, long double T) {
  return (cal1(p, T) - (T - 1) * pow(p, T) - 1) / (1 - p);
}
int chk(pdd a, pdd b, pdd c) {
  long double a1 = (b.second - a.second) / (a.first - b.first);
  long double a2 = (c.second - b.second) / (b.first - c.first);
  return a1 >= a2;
}
int cmp(pdd a, pdd b) {
  if (fabs(a.first - b.first) <= 1e-10) return a.second > b.second;
  return a.first < b.first;
}
long double trans(int x, long double ans, long long pos, long long nxt) {
  if (nxt == pos) return ans;
  long long X = nxt - pos;
  long double ai = a[sta[x].id], bi = b[sta[x].id], P = pi[sta[x].id],
              Q = 1 - P;
  long double val = pow(Q, X) * ans + ai * P * cal1(Q, X);
  val += mx * P * nxt * cal1(Q, X);
  val -= mx * P * cal2(Q, X);
  return val;
}
int main() {
  scanf("%d%lld", &n, &T);
  mx = 0;
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d%Lf", &a[i], &b[i], &pi[i]);
    mx = max(mx, b[i] * pi[i]);
    g[i] = pdd(pi[i], pi[i] * a[i], i);
  }
  sort(g + 1, g + n + 1, cmp);
  for (int i = 1; i <= n; ++i) {
    if (tp && fabs(sta[tp].first - g[i].first) <= 1e-10) continue;
    while (tp >= 2 && chk(sta[tp - 1], sta[tp], g[i])) tp--;
    sta[++tp] = g[i];
  }
  long double ans = 0;
  for (int i = 1; i <= n; ++i) ans = max(ans, pi[i] * a[i]);
  long long pos = 0, x = 1;
  while (pos < T) {
    if (x == tp) {
      ans = trans(tp, ans, pos, T - 1);
      break;
    } else {
      long long l = pos + 1, r = T - 1, nxt = pos;
      long double X = (sta[x].second - sta[x + 1].second) /
                      (sta[x + 1].first - sta[x].first);
      while (l <= r) {
        long long mid = l + r >> 1;
        long double d = -trans(x, ans, pos, mid - 1) + mx * mid;
        if (d <= X)
          nxt = mid, l = mid + 1;
        else
          r = mid - 1;
      }
      ans = trans(x, ans, pos, nxt);
      pos = nxt;
      x++;
    }
  }
  printf("%.15Lf", ans);
}