#include <bits/stdc++.h>
using namespace std;
int n;
double x[60010];
double v[60010];
int check(double m) {
  double l = x[0] - v[0] * m, r = x[0] + v[0] * m;
  for (int i = 1; i < n; i++) {
    double l1 = x[i] - v[i] * m, r1 = x[i] + v[i] * m;
    if (min(r1, r) < max(l, l1))
      return 0;
    else {
      l = max(l, l1);
      r = min(r, r1);
    }
  }
  return 1;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  double l = 0.0, r = 1000000000.0, ans = 0;
  while (r - l > 1e-7) {
    double mid = (l + r) / 2.0;
    if (check(mid)) {
      ans = mid;
      r = mid;
    } else {
      l = mid;
    }
  }
  printf("%.12lf", ans);
}
