#include <bits/stdc++.h> using namespace std; typedef long long ll; template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; } #define all(x) (x).begin(),(x).end() #define fi first #define se second #define mp make_pair #define si(x) int(x.size()) const int mod=998244353,MAX=300005; const ll INF=1LL<<60; bool seen[55][1<<12]; double dp[55][1<<12]; int N,M; double A[13],B[13],P[13]; double solve(int rem,int ok){ if(seen[rem][ok]) return dp[rem][ok]; if(ok==((1<<N)-1)) return 0; seen[rem][ok]=true; if(rem==0){ double ans=0; for(int i=0;i<N;i++){ if(!(ok&(1<<i))){ if(P[i]==1) ans+=max(A[i],B[i]); else ans+=A[i]; } } return dp[rem][ok]=ans; } double ma=0; for(int i=0;i<N;i++){ if(ok&(1<<i)) continue; double a=solve(rem,ok|(1<<i))+A[i]; double b=P[i]*(solve(rem,ok|(1<<i))+B[i])+(1.0-P[i])*solve(rem-1,ok); chmax(ma,a); chmax(ma,b); } return dp[rem][ok]=ma; } int main(){ std::ifstream in("text.txt"); std::cin.rdbuf(in.rdbuf()); cin.tie(0); ios::sync_with_stdio(false); cin>>N>>M; for(int i=0;i<N;i++){ int a,b,p;cin>>a>>b>>p; A[i]=(1.0)/a; B[i]=(1.0)/b; P[i]=(1.0)/p; } cout<<fixed<<setprecision(25)<<solve(M,0)<<endl; }