#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 111;
const double eps = 1e-9;
int n, s, k[N];
double x[N], y[N];
bool check(double l) {
  double mx = -1e9, mn = 1e9;
  for (int i = 1; i <= n; i++) {
    mx = max(mx, (x[i] - y[i] * l));
    mn = min(mn, (x[i] + y[i] * l));
  }
  return mx <= mn;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> x[i];
  for (int i = 1; i <= n; i++) cin >> y[i];
  double l = 0.0 - eps, r = 1e9 + eps;
  for (int it = 0; it < 100; ++it) {
    double md = (l + r) / 2.0;
    if (check(md))
      r = md;
    else
      l = md;
  }
  cout << setprecision(10) << fixed << l;
  return 0;
}
