#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  vector<long long> c(n), v(n);
  for (auto &i : c) cin >> i;
  for (auto &i : v) cin >> i;
  double l = 0, r = 1e9;
  double up, down;
  while (r - l > 1e-8) {
    double t = 1.0 * (l + r) / 2;
    up = 1e9, down = -1e9;
    for (long long i = 0; i < n; i++) {
      up = min(up, 1.0 * c[i] + 1.0 * t * v[i]);
      down = max(down, 1.0 * c[i] - 1.0 * t * v[i]);
    }
    if (up < down)
      l = t;
    else
      r = t;
  }
  cout << fixed << setprecision(8) << l;
}
