#include // #include #pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") using namespace std; // using namespace atcoder; using ll = long long; using str = string; using pl = pair; template using ml = map; using mll = ml; using sl = set; using dbl = double; using pd = pair; template using vec = vector; template using vv = vec>; template using vp = vec>; using vl = vec; using vvl = vec; using vs = vec; using vc = vec; using vpl = vec; using vd = vec; using vpd = vec; using tl3 = tuple; using ld = long double; const double INF = std::numeric_limits::infinity(); #define LL(x) \ ll x; \ cin >> x; #define STR(s) \ str s; \ cin >> s; #define VL(a, n) \ vl a(n); \ cin >> a; #define all(obj) (obj).begin(), (obj).end() #define reps(i, a, n) for (ll i = (a); i < (ll)(n); ++i) #define rep(i, n) reps(i, 0, n) #define rrep(i, n) reps(i, 1, n + 1) #define repds(i, a, n) for (ll i = (n - 1); i >= (a); i--) #define repd(i, n) repds(i, 0, n) #define rrepd(i, n) repds(i, 1, n + 1) #define rep2(i, j, x, y) rep(i, x) rep(j, y) template inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template ostream &operator<<(ostream &os, const pair &p) { os << p.first << " " << p.second; return os; } template istream &operator>>(istream &is, pair &p) { is >> p.first >> p.second; return is; } template ostream &operator<<(ostream &os, const vector &v) { for (int i = 0; i < (int)v.size(); i++) { os << v[i] << (i + 1 != (int)v.size() ? " " : ""); } return os; } template ostream &operator<<(ostream &os, const set &s) { os << vec(s.begin(), s.end()); return os; } template istream &operator>>(istream &is, vector &v) { for (T &in : v) is >> in; return is; } void print() { cout << '\n'; } template void print(const T &t) { cout << t << '\n'; } template void print(const Head &head, const Tail &...tail) { cout << head << ' '; print(tail...); } void print_accurate(dbl x) { cout << scientific << setprecision(15) << x << '\n'; } void print_accurate(ld x) { cout << scientific << setprecision(15) << x << '\n'; } void repr_(const ll &x) { cerr << x; } void repr_(const int &x) { cerr << x; } void repr_(const dbl &x) { cerr << x; } void repr_(const str &x) { cerr << x; } void repr_(const char &x) { cerr << x; } void repr_(const char *x) { cerr << x; } template void repr_(const pair &p); template void repr_(const map &m); template void repr_(const vec &v); template void repr_(const set &s); template void repr_(const pair &p) { cerr << '('; repr_(p.first); cerr << ", "; repr_(p.second); cerr << ')'; } template void repr_(const vec &v) { cerr << '['; for (int i = 0; i < (int)v.size(); i++) { repr_(v[i]); if (i + 1 != (int)v.size()) cerr << ", "; } cerr << ']'; } template void repr_(const set &s) { cerr << '{'; vec v = vec(all(s)); for (int i = 0; i < (int)v.size(); i++) { repr_(v[i]); if (i + 1 != (int)v.size()) cerr << ", "; } cerr << '}'; } template void repr_(const map &m) { cerr << '{'; vp v = vp(all(m)); for (int i = 0; i < (int)v.size(); i++) { repr_(v[i].first); cerr << ": "; repr_(v[i].second); if (i + 1 != (int)v.size()) cerr << ", "; } cerr << '}'; } template void repr_(const Head &head, const Tail &...tail) { repr_(head); repr_(' '); repr_(tail...); } template void repr(const T &t) { repr_(t); cerr << '\n'; } template void repr(const Head &head, const Tail &...tail) { repr_(head); repr_(' '); repr(tail...); } ll N, M; vec> ABP; map d; // ll cnt = 0; #define max(x, y) ((x) > (y) ? (x) : (y)) ld query(ll solved, ll m) { // if (cnt++ > 10) { // exit(0); // } // print("query", solved, m); if (d.find(pl(solved, m)) != d.end()) { return d[pl(solved, m)]; } ld temp = 0; rep(i, N) { if ((solved) & (1 << i)) continue; ll x = solved | (1 << i); // print(solved, m, i, (ld)1 / ABP.at(i).first + query(x, m)); chmax(temp, (ld)1 / ABP.at(i).first + query(x, m)); if (m > 0) { // print(solved, m, i, (ld)1 / ABP.at(i).second.second * ((ld)1 / ABP.at(i).second.first + query(x, m)) + (1 - (ld)1 / ABP.at(i).second.second) * (query(solved, m - 1))); chmax(temp, (ld)1 / ABP.at(i).second.second * ((ld)1 / ABP.at(i).second.first + query(x, m)) + (1 - (ld)1 / ABP.at(i).second.second) * (query(solved, m - 1))); } } d[pl(solved, m)] = temp; // print(solved, m, temp); return temp; } void solve() { cin >> N >> M; ABP = vec>(N); cin >> ABP; print_accurate(query(0, M)); } int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); solve(); return 0; }