#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <iterator>
#include <functional>
#include <complex>
#include <queue>
#include <stack>
#include <cmath>
#include <cassert>
#include <tuple>
using namespace std;
typedef long long LL;
typedef complex<double> CMP;
class DoraemonPuzzleGame { public:
double solve(vector <int> X, vector <int> Y, int m)
{
int N = X.size(), M = m;
vector<tuple<double,double,double>> P;
for(int i=0; i<N; ++i)
P.emplace_back(
(1000-X[i]-Y[i])*0.001,
X[i]*0.001,
Y[i]*0.001
);
sort(P.begin(), P.end(), [&](const tuple<double,double,double>& lhs, const tuple<double,double,double>& rhs){
if(get<2>(lhs) != get<2>(rhs)) return get<2>(lhs) > get<2>(rhs);
if(get<1>(lhs) != get<1>(rhs)) return get<1>(lhs) > get<1>(rhs);
return get<0>(lhs) > get<0>(rhs);
});
return solve(M-N, P);
}
double solve(int Extra, const vector<tuple<double,double,double>>& P)
{
double eee = 0.0;
for(int eff=0; eff<=P.size(); ++eff)
{
double e_clear = 0.0;
vector<double> adv(1, 1.0); // adv[0] = 1.0;
for(int i=0; i<P.size(); ++i) {
double p1 = get<1>(P[i]);
double p2 = get<2>(P[i]);
if(i<eff) {
e_clear += 1/p2;
} else {
double p = p1 + p2;
e_clear += 1/p;
vector<double> a2(adv.size()+1);
for(int i=0; i<adv.size(); ++i) {
a2[i] += adv[i] * p1/p;
a2[i+1] += adv[i] * p2/p;
}
adv = a2;
}
}
if(Extra <= eff) {
best = min(best, e_clear);
} else {
best = min(best,
}
}
return eee;
}
};
// BEGIN CUT HERE
#include <ctime>
double start_time; string timer()
{ ostringstream os; os << " (" << int((clock()-start_time)/CLOCKS_PER_SEC*1000) << " msec)"; return os.str(); }
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v)
{ os << "{ ";
for(typename vector<T>::const_iterator it=v.begin(); it!=v.end(); ++it)
os << '\"' << *it << '\"' << (it+1==v.end() ? "" : ", "); os << " }"; return os; }
void verify_case(const double& Expected, const double& Received) {
bool ok = (abs(Expected - Received) < 1e-9);
if(ok) cerr << "PASSED" << timer() << endl; else { cerr << "FAILED" << timer() << endl;
cerr << "\to: \"" << Expected << '\"' << endl << "\tx: \"" << Received << '\"' << endl; } }
#define CASE(N) {cerr << "Test Case #" << N << "..." << flush; start_time=clock();
#define END verify_case(_, DoraemonPuzzleGame().solve(X, Y, m));}
int main(){
CASE(0)
int X_[] = {800};
vector <int> X(X_, X_+sizeof(X_)/sizeof(*X_));
int Y_[] = {200};
vector <int> Y(Y_, Y_+sizeof(Y_)/sizeof(*Y_));
int m = 2;
double _ = 5.0;
END
CASE(1)
int X_[] = {1,999,999};
vector <int> X(X_, X_+sizeof(X_)/sizeof(*X_));
int Y_[] = {999,1,1};
vector <int> Y(Y_, Y_+sizeof(Y_)/sizeof(*Y_));
int m = 3;
double _ = 3.0;
END
CASE(2)
int X_[] = {500,500};
vector <int> X(X_, X_+sizeof(X_)/sizeof(*X_));
int Y_[] = {500,500};
vector <int> Y(Y_, Y_+sizeof(Y_)/sizeof(*Y_));
int m = 3;
double _ = 2.5;
END
CASE(3)
int X_[] = {250,250,250,250};
vector <int> X(X_, X_+sizeof(X_)/sizeof(*X_));
int Y_[] = {250,250,250,250};
vector <int> Y(Y_, Y_+sizeof(Y_)/sizeof(*Y_));
int m = 5;
double _ = 8.25;
END
CASE(4)
int X_[] = {250,500,250};
vector <int> X(X_, X_+sizeof(X_)/sizeof(*X_));
int Y_[] = {500,250,500};
vector <int> Y(Y_, Y_+sizeof(Y_)/sizeof(*Y_));
int m = 5;
double _ = 4.962962962962963;
END
CASE(5)
int X_[] = {600,900,800,500,900,200,400,100,800,300,900,300,800,700,800,600,800,900,400,100,100,700,600,100,500,
800,700,600,900,600,300,100,300,100,700,500,900,200,800,400,300,700,300,400,700,300,400,800,300,200};
vector <int> X(X_, X_+sizeof(X_)/sizeof(*X_));
int Y_[] = {400,100,200,500,100,800,600,900,200,700,100,700,200,300,200,400,200,100,600,900,900,300,400,900,500,
200,300,400,100,400,700,900,700,900,300,500,100,800,200,600,700,300,700,600,300,700,600,200,700,800};
vector <int> Y(Y_, Y_+sizeof(Y_)/sizeof(*Y_));
int m = 95;
double _ = 119.33578280666175;
END
/*
CASE(6)
int X_[] = ;
vector <int> X(X_, X_+sizeof(X_)/sizeof(*X_));
int Y_[] = ;
vector <int> Y(Y_, Y_+sizeof(Y_)/sizeof(*Y_));
int m = ;
double _ = ;
END
CASE(7)
int X_[] = ;
vector <int> X(X_, X_+sizeof(X_)/sizeof(*X_));
int Y_[] = ;
vector <int> Y(Y_, Y_+sizeof(Y_)/sizeof(*Y_));
int m = ;
double _ = ;
END
*/
}
// END CUT HERE