#include using namespace std; using ll = long long; ll dp[2][310][310][310]; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin>>n; vector a(n),b(n); for(int i = 0;i>a[i]; for(int i = 0;i>b[i]; vector> st; for(int i = 0;i=2){ auto now = st.back(); st.pop_back(); auto nxt = st.back(); st.pop_back(); if(now.first/now.second <= nxt.first/nxt.second){ now.first += nxt.first; now.second += nxt.second; st.push_back(now); }else{ st.push_back(nxt); st.push_back(now); break; } } } double ans = 0; for(int i = 0;i