#include <bits/stdc++.h>
using namespace std;
long long int logy(long long int x, long long int y) {
  return ceil((long double)(log(x) / log(y)));
}
long long int powe(long long int a, long long int b) {
  long long int re = 1;
  while (b) {
    if (b & 1) re = (re * a);
    a = (a * a);
    b = b >> 1;
  }
  return re;
}
bool flag = 0, flag1 = 0, flag2 = 0;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int tt = 1;
  while (tt--) {
    long long int n;
    cin >> n;
    long double a[n], v[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    ;
    for (int i = 0; i < n; i++) cin >> v[i];
    ;
    long double i = 0, j = 1e10, mid, ans = 1e10;
    while (abs(i - j) >= 0.0000001) {
      mid = (i + j) / 2;
      long double l = -1, r = 1e10;
      for (long long int k = 0; k < n; k++) {
        l = max(l, a[k] - mid * v[k]);
        r = min(r, a[k] + mid * v[k]);
      }
      if (l <= r)
        ans = min(ans, mid), j = mid;
      else
        i = mid;
    }
    cout << fixed << setprecision(10) << ans;
  }
  return 0;
}
