#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<long double> x(n), v(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < n; i++) cin >> v[i];
  long double l = 0, r = 1e9, ans = 1e9;
  while (l <= r) {
    long double mid = (l + r) / 2.0;
    vector<pair<long double, int> > a;
    for (int i = 0; i < n; i++) {
      a.push_back(make_pair(x[i] - v[i] * mid, 0));
      a.push_back(make_pair(x[i] + v[i] * mid, 1));
    }
    sort(a.begin(), a.end());
    int b = 0;
    bool f = false;
    for (int i = 0; i < a.size(); i++) {
      if (a[i].second == 0)
        b++;
      else
        b--;
      if (b == n) f = true;
    }
    if (f) {
      ans = mid;
      r = mid - 0.00000001;
    } else
      l = mid + 0.00000001;
  }
  cout << fixed << setprecision(9) << ans << endl;
  return 0;
}
