#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> v(n), vv(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
  for (int j = 0; j < n; ++j) {
    cin >> vv[j];
  }
  double start = 0, end = 1e10, mid, minn = -1;
  for (int k = 0; k < 100; ++k) {
    mid = (start + end) / 2.0;
    double maxx = -1e10, minn2 = 1e10;
    for (int i = 0; i < n; ++i) {
      maxx = max((double)maxx, (double)v[i] - vv[i] * mid);
      minn2 = min((double)minn2, (double)v[i] + vv[i] * mid);
    }
    if (maxx > minn2) {
      start = mid;
    } else {
      minn = mid;
      end = mid;
    }
  }
  cout << fixed << setprecision(6) << minn;
  return 0;
}
