#include <bits/stdc++.h>
using namespace std;
const int N = 6e4 + 3;
const double INF = 1e9;
int n;
double a[N], b[N], mx, mn, x, y;
bool can(double m) {
  mx = 0;
  mn = INF;
  for (int i = 1; i <= n; i++) {
    x = max(a[i] - b[i] * m, 1.0);
    y = min(a[i] + b[i] * m, INF);
    mx = max(mx, x), mn = min(mn, y);
  }
  if (mx <= mn) return 1;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  double l = 0, r = 1e9, m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> b[i];
  for (int i = 1; i <= 100; i++) {
    m = (l + r) / 2;
    if (can(m))
      r = m;
    else
      l = m;
  }
  printf("%.7f", l);
}
