#include <bits/stdc++.h>
using namespace std;
int const N = 200001;
int n, x[N], v[N];
double ok(double p) {
  double t = 0;
  for (int i = 0; i < n; ++i) {
    double cur = abs(x[i] - p) / (v[i] * 1.0);
    t = max(t, cur);
  }
  return t;
}
int main() {
  scanf("%d", &n);
  double md = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d", x + i);
    md += x[i];
  }
  for (int i = 0; i < n; ++i) scanf("%d", v + i);
  double l = 0, r = 1e9, md1, md2, an = 1e9, ct = 0;
  while (ct++ < 1000) {
    md1 = l + (r - l) / 3;
    md2 = r - (r - l) / 3;
    double d0 = ok(md1);
    double d1 = ok(md2);
    an = min({an, d0, d1});
    if (d0 >= d1) {
      l = md1;
    } else
      r = md2;
  }
  printf("%.9lf\n", an);
}
