#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 60000;
int x[MAX_N], v[MAX_N];
int n;
double get(double xc) {
  double ans = 0.0;
  for (int i = 0; i < n; i++) {
    ans = max(ans, max(x[i] - xc, xc - x[i]) / (double)v[i]);
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < n; i++) cin >> v[i];
  double l = -1, r = 1e9 + 1;
  for (int _ = 0; _ < 200; _++) {
    double m1 = l + (r - l) / 3, m2 = r - (r - l) / 3;
    if (get(m1) < get(m2)) {
      r = m2;
    } else {
      l = m1;
    }
  }
  cout.precision(20);
  cout << get(l);
  return 0;
}
