#include <bits/stdc++.h>
using namespace std;
double ind[60010], v[60010];
int n;
double f(double a) {
  double t1 = 0;
  for (int i = 1; i <= n; i++) {
    double d = fabs(a - ind[i]);
    double t = d / v[i];
    t1 = max(t1, t);
  }
  return t1;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", &ind[i]);
  for (int i = 1; i <= n; i++) scanf("%lf", &v[i]);
  double l, r;
  l = -1000000000.0;
  r = 1000000000.0;
  for (int i = 1; i <= 500; i++) {
    double ll = l + (r - l) / 3;
    double rr = l + 2 * (r - l) / 3;
    if (f(rr) - f(ll) > 1e-7)
      r = rr;
    else
      l = ll;
  }
  printf("%.12lf\n", f(l));
  return 0;
}
