#include <bits/stdc++.h>
using namespace std;
double n, a[int(6 * 1e4 + 7)], b[int(6 * 1e4 + 7)], ans = 1.0 * 1e9 + 2911;
double Calc(double x) {
  double rt = 0.0 * 1e9;
  for (int i = 1; i <= n; ++i) {
    rt = max(rt, abs(a[i] - x) / b[i]);
  }
  return rt;
}
void Solve() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i) cin >> b[i];
  double l = 1.0, r = 1.0 * 1e9, mid, es = 0.0000001, t1, t2;
  while (r - l >= es) {
    mid = (l + r) / 2;
    t1 = Calc(mid - es);
    t2 = Calc(mid + es);
    if (t1 < t2)
      r = mid - es;
    else
      l = mid + es;
    ans = min(ans, min(t1, t2));
  }
  cout << fixed << setprecision(12) << ans;
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) {
    Solve();
  }
  return 0;
}
