#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long f = 1, x = 0;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -1;
  } while (ch < '0' || ch > '9');
  do {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return f * x;
}
const int MAXN = 60000 + 10;
int n;
int x[MAXN];
int v[MAXN];
inline bool check(double mid) {
  double li = x[1] - v[1] * mid;
  double ri = x[1] + v[1] * mid;
  for (int i = 2; i <= n; i++) {
    double resl = x[i] - v[i] * mid;
    double resr = x[i] + v[i] * mid;
    li = max(resl, li);
    ri = min(resr, ri);
  }
  if (ri - li >= 1e-7)
    return true;
  else
    return false;
}
int main() {
  n = read();
  for (int i = 1; i <= n; i++) x[i] = read();
  for (int i = 1; i <= n; i++) v[i] = read();
  double ans = 999999999;
  double l = 0.0, r = 1000000000.0;
  for (int i = 1; i <= 100; i++) {
    double mid = (l + r) / 2;
    if (check(mid))
      ans = min(ans, mid), r = mid;
    else
      l = mid;
  }
  printf("%.6f\n", ans);
}
