#include <bits/stdc++.h>
using namespace std;
long long int n, x[70000], v[70000], p = 1e+7, k;
bool check(double m) {
  double up = x[0] + v[0] * m, low = x[0] - v[0] * m;
  for (int i = 1; i < n; i++) {
    double l = x[i] - v[i] * m, r = x[i] + v[i] * m;
    if (r < low || l > up)
      return false;
    else {
      up = min(up, r);
      low = max(low, l);
    }
  }
  return true;
}
int main() {
  double up = 1e9, low = 0, mid;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < n; i++) cin >> v[i];
  while (up - low > 1e-6) {
    mid = (up + low) / 2;
    if (check(mid))
      up = mid;
    else
      low = mid;
  }
  printf("%.12f\n", up);
  return 0;
}
