#include using namespace std; using P = pair; int main () { int N; cin >> N; vector

A(N); for (auto& [a, b] : A) { cin >> a; } for (auto& [a, b] : A) { cin >> b; } double ans = 0; for (auto [a, b] : A) { if (a <= b) { ans += a + b; } else { ans += 2 * sqrt(a * b); } } cout << setprecision(20) << ans << endl; }