#include <bits/stdc++.h>
using namespace std;
long double x[120001], v[120001], l, r, d, ln, rn, ans;
int n, i, z;
bool f(long double t) {
  ln = -1e18;
  rn = 1e18;
  for (i = 1; i <= n; i++) {
    ln = max(ln, x[i] - v[i] * t);
    rn = min(rn, x[i] + v[i] * t);
  }
  if (!(rn - ln < 0.)) return 1;
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%Lf", &x[i]);
  for (i = 1; i <= n; i++) scanf("%Lf", &v[i]);
  r = 1000000000.;
  for (z = 1; z <= 200; z++) {
    d = (l + r) / 2.;
    if (f(d))
      ans = r = d;
    else
      l = d;
  }
  printf("%.10Lf\n", ans);
  return 0;
}
