#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9;
const long long MAXN = 60000;
long double x[MAXN], v[MAXN];
long long n;
int main() {
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> x[i];
  for (long long i = 0; i < n; i++) cin >> v[i];
  long double l = 0.0, h = (long double)inf, mid;
  while (h - l > .000001) {
    long double tmx = -1e18;
    long long pos;
    mid = (h + l) / 2;
    for (long long i = 0; i < n; i++) {
      long double t = fabs(x[i] - mid) / v[i];
      if (t > tmx) {
        tmx = t;
        pos = i;
      }
    }
    if (x[pos] > mid)
      l = mid;
    else if (x[pos] < mid)
      h = mid;
  }
  long double min_time = -1e18;
  for (long long i = 0; i < n; i++) {
    long double time = fabs(x[i] - mid) / v[i];
    min_time = max(min_time, time);
  }
  cout << fixed << setprecision(10) << min_time << endl;
  return 0;
}
