#include <bits/stdc++.h>
using namespace std;
double x[100004], v[100004];
int n;
bool ch(double m) {
  double c1 = -1e18;
  double c2 = 1e18;
  for (int i = 0; i < n; i++) {
    c1 = max(c1, x[i] - m * v[i]);
    c2 = min(c2, x[i] + m * v[i]);
  }
  if (c1 <= c2)
    return true;
  else
    return false;
}
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 = 1e18, ans;
  for (int i = 0; i <= 150; i++) {
    double mid = (l + r) / 2.0;
    if (ch(mid)) {
      ans = mid;
      r = mid;
    } else
      l = mid;
  }
  printf("%.6lf\n", ans);
  return 0;
}
