#include <bits/stdc++.h>
using namespace std;
int n;
double x[100000], v[100000];
double f(double dx) {
  double ans = 0;
  for (int i = 0; i < n; ++i) {
    ans = max(ans, abs(dx - x[i]) / v[i]);
  }
  return ans;
}
void init() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> x[i];
  for (int i = 0; i < n; ++i) cin >> v[i];
}
void solve() {
  double l = 1, r = 1000000000;
  for (int i = 0; i < 300; ++i) {
    double m1 = l + (r - l) / 3, m2 = r - (r - l) / 3;
    if (f(m1) < f(m2))
      r = m2;
    else
      l = m1;
  }
  cout << setprecision(100) << min(f(l), f(r));
}
signed main() {
  init();
  solve();
  return 0;
}
