#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char chr = getchar();
  int f = 1, ans = 0;
  while (!isdigit(chr)) {
    if (chr == '-') f = -1;
    chr = getchar();
  }
  while (isdigit(chr)) {
    ans = ans * 10;
    ans += chr - '0';
    chr = getchar();
  }
  return ans * f;
}
int n;
int x[60005], v[60005];
bool pd(double p) {
  double maxn = -2e11, minn = 2e11;
  for (int i = 1; i <= n; i++) {
    maxn = max(x[i] - v[i] * p, maxn);
    minn = min(x[i] + v[i] * p, minn);
  }
  return minn >= maxn;
}
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 l = 0, r = 1000000000, mid, eps = 1e-6;
  while (l - r <= eps) {
    double mid = (l + r) / 2;
    if (pd(mid))
      r = mid - eps;
    else
      l = mid + eps;
  }
  printf("%.10f", l);
  return 0;
}
