#include <bits/stdc++.h>
double x[60001], v[60001];
int n;
double l, r, mid;
bool check(double ans) {
  double lmax = -0x7fffffff, rmin = 0x7fffffff;
  for (int i = 1; i <= n; i++) {
    if (x[i] + v[i] * ans < rmin) rmin = x[i] + v[i] * ans;
    if (x[i] - v[i] * ans > lmax) lmax = x[i] - v[i] * ans;
  }
  if (lmax <= rmin) return 1;
  return 0;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", &x[i]);
  for (int i = 1; i <= n; i++) scanf("%lf", &v[i]);
  l = 0, r = 1000000000;
  while (r - l >= 0.000001) {
    mid = (l + r) / 2;
    if (check(mid)) {
      r = mid;
    } else {
      l = mid;
    }
  }
  printf("%.12lf\n", mid);
  return 0;
}
