#include <bits/stdc++.h>
using namespace std;
int x[60010], v[60010];
int main() {
  int n;
  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;
  double r = 1e9;
  double mx;
  while (r - l > 1e-8) {
    double mid = (l + r) / 2;
    mx = 0;
    bool b;
    for (int i = 0; i < n; i++) {
      double cur = abs(x[i] - mid) / v[i];
      if (cur > mx) {
        mx = cur;
        b = x[i] > mid;
      }
    }
    if (b)
      l = mid;
    else
      r = mid;
  }
  cout << setprecision(9) << fixed << mx << endl;
  return 0;
}
