#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
const long long LINF = 1LL * 2e18;
const double EPS = 1e-9;
const int MAXN = 1e6 + 10;
const int N = 1e5 + 10;
void rf() {}
int n;
pair<int, int> a[N];
bool ok(long double t) {
  long double l = -LINF, r = LINF;
  for (int i = 1; i <= n; i++) {
    long double cur_l = -t * a[i].second + a[i].first;
    long double cur_r = t * a[i].second + a[i].first;
    if (cur_l - l > EPS) l = cur_l;
    if (r - cur_r > EPS) r = cur_r;
    if (l - r > EPS) return false;
  }
  return true;
}
int main() {
  rf();
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i].first);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i].second);
  }
  sort(a + 1, a + n + 1);
  long double l = 0, r = INF;
  long double ans;
  for (int i = 1; i <= 200; i++) {
    long double m = (l + r) / 2;
    if (ok(m)) {
      r = m - 1;
      ans = m;
    } else {
      l = m + 1;
    }
  }
  printf("%.6f", (double)ans);
  return 0;
}
