#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<pair<double, double> > vec(n);
  for (long long i = 0; i < n; i++) cin >> vec[i].first;
  for (long long i = 0; i < n; i++) cin >> vec[i].second;
  sort(vec.begin(), vec.end());
  double l = 0, r = 1000000000;
  double mid;
  while ((r - l) >= 0.000001) {
    double right = LLONG_MAX, left = LLONG_MIN;
    mid = l + (r - l) / 2;
    for (long long i = 0; i < n; i++) {
      double rt = vec[i].first + (vec[i].second * mid);
      double lt = vec[i].first - vec[i].second * mid;
      left = max(left, lt);
      right = min(right, rt);
    }
    if (right < left)
      l = mid + 0.000001;
    else
      r = mid;
  }
  printf("%lf\n", l);
}
