#include <bits/stdc++.h>
using namespace std;
const int inf = 0xf3f3f3f;
const int maxn = 60005;
int a[maxn], b[maxn], n;
double ll, rr;
int C(double mid) {
  ll = max(1.0, a[1] - b[1] * mid);
  rr = a[1] + b[1] * mid;
  for (int i = 2; i <= n; i++) {
    double l = max(1.0, a[i] - b[i] * mid);
    double r = a[i] + b[i] * mid;
    if (l > rr || r < ll) return 0;
    ll = max(ll, l);
    rr = min(rr, r);
  }
  return 1;
}
int main() {
  int minl = inf, maxr = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    maxr = max(maxr, a[i]);
    minl = min(minl, a[i]);
  }
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  double l = 0, r = maxr - minl;
  int t = 100;
  while (t--) {
    double mid = (l + r) / 2;
    if (C(mid)) {
      r = mid;
    } else
      l = mid;
  }
  printf("%.12lf\n", r);
  return 0;
}
