#include <bits/stdc++.h>
using namespace std;
vector<long long> x;
vector<long long> v;
int n;
bool f(long double t) {
  vector<long double> l(n), r(n);
  for (int i = 0, to = n; i < to; i++) {
    l[i] = x[i] - v[i] * t;
    r[i] = x[i] + v[i] * t;
  }
  long double maxL = *max_element(l.begin(), l.end());
  long double minR = *min_element(r.begin(), r.end());
  if (maxL > minR) {
    return false;
  } else
    return true;
}
const long double EPS = 1e-6;
void solve() {
  cin >> n;
  x.resize(n);
  v.resize(n);
  for (int i = 0, to = n; i < to; i++) cin >> x[i];
  for (int i = 0, to = n; i < to; i++) cin >> v[i];
  long double lo = 0, hi = 1e9;
  while (hi - lo > EPS) {
    long double mi = (hi + lo) / 2;
    if (f(mi)) {
      hi = mi;
    } else {
      lo = mi;
    }
  }
  cout << setprecision(10) << fixed << hi << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  int t = 1;
  while (t--) solve();
  return 0;
}
