#include <bits/stdc++.h>
using namespace std;
double sl, sr, k, l, r = 99999999999.0, t1, t2, s;
struct node {
  double x, v;
} a[60010];
int n;
bool cmp(node x, node y) { return x.x < y.x; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lf", &a[i].x);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%lf", &a[i].v);
  }
  sort(a + 1, a + n + 1, cmp);
  k = (a[1].x + a[n].x) / 2;
  while (r - l > 0.0000001) {
    s = (l + r) / 2;
    sl = 9999999999.0;
    sr = -9999999999.0;
    for (int i = 1; i <= n; i++) {
      sl = min(sl, a[i].v * s + a[i].x);
    }
    for (int i = 1; i <= n; i++) {
      sr = max(sr, a[i].x - a[i].v * s);
    }
    if (sr >= sl)
      l = s;
    else
      r = s;
  }
  printf("%.12lf", l);
  return 0;
}
