#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-7;
int x[60020], v[60020];
inline int F(const double x) {
  if (x > EPS) return 1;
  if (x < -EPS) return -1;
  return 0;
}
int main(void) {
  int n;
  int i;
  double l, r, m;
  double a, b;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &x[i]);
  for (i = 1; i <= n; i++) scanf("%d", &v[i]);
  for (l = 0, r = 1e9 + 7; F(l - r) < 0;) {
    m = (l + r) * 0.5;
    a = x[1] - v[1] * m;
    b = x[1] + v[1] * m;
    for (i = 2; i <= n; i++) {
      a = max(a, x[i] - v[i] * m);
      b = min(b, x[i] + v[i] * m);
    }
    (F(a - b) <= 0 ? r : l) = m;
  }
  printf("%.7lf\n", r);
  return 0;
}
