#include <bits/stdc++.h>
using namespace std;
double n, x[100009] = {}, v[100009] = {};
long long fact(long long r) {
  if (r <= 1)
    return 1;
  else
    return r * fact(r - 1);
}
double t(double in) {
  double res = 0;
  for (int i = 0; i < n; i++) {
    res = max(res, abs(x[i] - in) / v[i]);
  }
  return res;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < n; i++) cin >> v[i];
  double l = 0, h = 1e9;
  double res = 0;
  double m1 = 0, m2 = 0;
  while (h - l >= 1e-6) {
    double mid1 = l + (h - l) / 3, mid2 = h - (h - l) / 3;
    m1 = t(mid1), m2 = t(mid2);
    if (m1 < m2)
      h = mid2;
    else
      l = mid1;
    res = min(m1, m2);
  }
  cout << fixed << setprecision(6) << res;
  return 0;
}
