#include <bits/stdc++.h>
using namespace std;
vector<pair<long double, long double> > arr;
long double n;
long double how(long double x) {
  long double ret = 0;
  for (long double i = 0; i < n; i++) {
    ret = max(ret, fabs(arr[i].first - x) / arr[i].second);
  }
  return ret;
}
int main() {
  long double ans = 0;
  cin >> n;
  arr.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i].first;
  }
  for (int i = 0; i < n; i++) {
    cin >> arr[i].second;
  }
  sort(arr.begin(), arr.end());
  long double L = arr[0].first;
  long double R = arr[n - 1].first;
  long double anL = how(arr[0].first);
  ans = 0;
  long double anR = how(arr[n - 1].first);
  for (int i = 0; i < 1e3; i++) {
    long double miL = L + (R - L) / 3;
    long double miR = R - (R - L) / 3;
    long double noL = how(miL);
    long double noR = how(miR);
    if (noR > noL) {
      anR = noR;
      R = miR;
    } else {
      anL = noL;
      L = miL;
    }
  }
  cout.precision(8);
  cout << fixed << anL + (anR - anL) / 3;
  return 0;
}
