#include <bits/stdc++.h>
using namespace std;
int n, i, x[60005], v[60005];
double max(double x, double y) {
  if (x > y)
    return x;
  else
    return y;
}
double min(double x, double y) {
  if (x < y)
    return x;
  else
    return y;
}
bool judge(double t) {
  double l, r, ll, rr;
  l = x[0] - v[0] * t;
  r = x[0] + v[0] * t;
  for (i = 1; i < n; i++) {
    ll = x[i] - v[i] * t;
    rr = x[i] + v[i] * t;
    if (ll > r || rr < l) return false;
    l = max(l, ll);
    r = min(r, rr);
  }
  return true;
}
int main() {
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &x[i]);
  for (i = 0; i < n; i++) scanf("%d", &v[i]);
  double l = 0, r = 1e9, m;
  for (int j = 0; j <= 1000; j++) {
    m = (l + r) / 2.0;
    if (judge(m))
      r = m;
    else
      l = m;
  }
  printf("%.12lf\n", (l + r) / 2.0);
  return 0;
}
