#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")
using namespace std;
const long long MAXN = 1e5 + 7;
void check() {
  long long n;
  cin >> n;
  long long a[n + 1], sp[n + 1];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < n; i++) {
    cin >> sp[i];
  }
  auto get = [&](long double x) -> bool {
    long double mn = 1e10;
    long double mx = -1e10;
    for (long long i = 0; i < n; i++) {
      mn = min(mn, a[i] + sp[i] * x);
      mx = max(mx, a[i] - sp[i] * x);
    }
    return mn <= mx;
  };
  long double l = 0, r = 1e10;
  long double m;
  for (long long t = 0; t < 100; t++) {
    m = (l + r) / 2;
    if (get(m)) {
      l = m;
    } else {
      r = m;
    }
  }
  cout << fixed << setprecision(6) << m << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  for (int i = 1; i <= t; i++) {
    check();
  }
  return 0;
}
