#include #include #include #include using namespace std; int main(){ int N; while(cin >> N){ vector p(N), q(N); vector A(N); for(auto& t : p) cin >> t; for(auto& t : q) cin >> t; for(auto& t : A) cin >> t; double L = 0.0, R = 1.0; for(int _=0;_<200;_++){ double mid = 0.5*(L+R); double sum = 0.0; for(int i=0;i mid) L = mid; else R = mid; } double X = 0.5*(L+R); double res = 0.0; for(int i=0;i