Problem: Idol --- It's the eternal longing of girls. However, only a handful stand at the top. You have decided to enter such a survival world as an idol producer. And today, I will take your idol and challenge an important audition.

The three elements that determine the audition are visual, dance, and vocal. There are m appeal times during the audition, and each idol can make a visual appeal, a dance appeal, or a vocal appeal for each appeal time. When you make a visual appeal, the idol's visual points are only her visual value, when you make a dance appeal, the dance points are only her dance value, and when you make a vocal appeal, the vocal points are only her vocal value. Will rise.

After m appeals, 3 of the N idols with the highest visual points have 5 audition points, 3 with the highest dance points have 3 audition points, and 3 with the highest vocal points. 2 Earn audition points. On the other hand, if the visual points are the lowest, the audition points will be deducted by 1 point, if the dance points are the lowest, the audition points will be deducted by 1 point, and if the vocal points are the lowest, the audition points will be deducted by 1 point. (Even if the audition point is 1 or less, 1 point will be deducted from it).

At the beginning of the audition, each idol has 0 visual points, dance points, and vocal points. You are the producer of Idol 1 and you can tell which appeal to make at each appeal time. Idols other than Idol 1 will randomly make one of the appeals at equal probability at each appeal time (that is, each with a one-third chance). If idol 1 has the same visual, dance, and vocal points as other idols, idol 1 is always inferior. Find the expected value when instructed to maximize the expected value of the audition points earned by Idol 1. The fate of an idol depends on your instructions!

By the way, all instructions are given before the audition starts, and the instructions cannot be changed during the audition after that. In other words, it is not possible for other idols to see which appeal they have made since the audition began and then give instructions to maximize the expected value in that case.



Input

The input is given in the form:

> n m
> vi1 da1 vo1
> vi2 da2 vo2
> ...
> vin dan von
>

The first line shows the number of idols participating in the audition n (4 ≤ n ≤ 2000) and the number of appeal times in this audition m (1 ≤ m ≤ 2000). The next n lines contain the visual value vii, dance value dai, and vocal value voi (1 ≤ vii, dai, voi ≤ 10,000) for idle i, respectively.

Output

Output the maximum expected value of audition points earned by idle 1 in one line.

Examples

Input

4 1
1 1 1
1 1 1
1 1 1
1 1 1


Output

2.777777777778


Input

4 10
1 1 1
10 10 10
10 10 10
10 10 10


Output

-2.335340954780


Input

9 9
13 5 19
19 21 37
15 1 7
7 11 15
21 23 25
33 29 19
13 19 11
21 5 15
7 13 1


Output

4.678837855075

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
typedef long long ll;
typedef double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-12;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/

int n, m;
vector<short> point[3];
ld p[2222], win[2222][2222];
ld dp[2222][2222][4], exper[3][2222];
ld score[] = { 5,3,2 };

ld calc(int m, int i)
{
	ld res = 1.0;
	int a = m - i;
	REP(j, i)
	{
		res *= ld(m - j);
		res /= ld(j + 1);
		res /= 3.0;
		if (a > 0)
		{
			res *= 2.0 / 3.0;
			a--;
		}
	}
	while (a > 0)
	{
		res *= 2.0 / 3.0;
		a--;
	}
	return res;
}

int main()
{
	cin.sync_with_stdio(false); cout << fixed << setprecision(10);
	cin >> n >> m;
	REP(i, 3) point[i].resize(n);
	REP(i, m + 1)
	{
		p[i] = calc(m, i);
	}
	for (int i = m - 1; i >= 0; i--) p[i] += p[i + 1];
	REP(i, n)REP(j, 3) cin >> point[j][i];
	REP(i, 3)
	{
		REP(j, m + 1)FOR(k, 1, n)
		{
			int need;
			int my = j * point[i][0];
			if (my % point[i][k] == 0) need = my / point[i][k];
			else need = my / point[i][k] + 1;
			win[j][k] = 1 - p[min(need, m + 1)];
		}
		REP(j, 2222)REP(k, 2222)REP(l, 4) dp[j][k][l] = 0.0;
		REP(j, 2222) dp[j][0][0] = dp[j][0][3] = 1.0;
		REP(j, m + 1)
		{
			FOR(k, 1, n)
			{
				REP(l, 3)
				{
					dp[j][k][l] += dp[j][k - 1][l] * win[j][k];
					if (l != 2) dp[j][k][l + 1] += dp[j][k - 1][l] * (1 - win[j][k]);
					if (dp[j][k][l] < EPS) dp[j][k][l] = 0;
				}
				dp[j][k][3] = dp[j][k - 1][3] * (1 - win[j][k]);
				if (dp[j][k][3] < EPS) dp[j][k][3] = 0;
			}
		}
		REP(j, m + 1) exper[i][j] = (dp[j][n - 1][0] + dp[j][n - 1][1] + dp[j][n - 1][2])*score[i] - dp[j][n - 1][3];
	}
	ld ans = -INF;
	REP(i, m + 1)REP(j, m + 1)
	{
		int k = m - i - j;
		if (k < 0) continue;
		ld tmp = exper[0][i] + exper[1][j] + exper[2][k];
		chmax(ans, tmp);
	}
	cout << ans << endl;
	return 0;
}