#include <bits/stdc++.h>
using namespace std;
int n;
vector<long double> x, v;
long double ans = 2e18;
long double check(long double m) {
  long double ret = 0;
  for (int i = 0; i < n; i++) ret = max(ret, fabs(x[i] - m) / v[i]);
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  cout.precision(16);
  cin >> n;
  x.resize(n);
  v.resize(n);
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < n; i++) cin >> v[i];
  long double l = 0, m1, m2, r = 2e9;
  for (int z = 0; z < 1000; z++) {
    m1 = l + (r - l) / 3;
    m2 = l + (r - l) / 3 * 2;
    if (check(m1) < check(m2))
      r = m2;
    else
      l = m1;
  }
  cout << check(l);
  return 0;
}
