nn, m = map(int,input().split()) d = [] n = 0 ans = 0 for i in range(nn): a, b, p = map(int,input().split()) if a <= b: ans += 1 / a elif p == 1: ans += 1 / b assert(0) else: d.append((a, b, p)) n += 1 d.sort(key= lambda x:(-(1/x[1] - 1/x[0])*1/x[2], x[1])) dp = [0.0] * (n+1) dp[0] = 1.0 for i in range(m): ndp = [0.0] * (n+1) for j in range(n+1): tar = 1.0 for k in range(j, n): ndp[k] += dp[j] * tar * (1 - 1/d[k][2]) tar *= 1/d[k][2] ndp[n] += dp[j] * tar dp = ndp tmp = 0.0 for i in range(n): tmp += 1 / d[i][0] #print(tmp) for i in range(n+1): ans += tmp * dp[i] if i < n: tmp -= 1 / d[i][0] tmp += 1 / d[i][1] #print(tmp, dp[i]) print(ans)