#include <bits/stdc++.h>
using namespace std;
int n;
long long x[60000], v[60000];
bool can(double t) {
  double X = 0, Y = 1e9 + 1;
  for (int i = 0; i < n; i++) {
    X = max(X, x[i] - t * v[i]);
    Y = min(Y, x[i] + t * v[i]);
  }
  return (Y - X) >= 0.0;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", x + i);
  for (int i = 0; i < n; i++) scanf("%d", v + i);
  double L = 0, R = 1e9, mid;
  while (R - L > 1e-7) {
    mid = (L + R) / 2.0;
    if (can(mid))
      R = mid;
    else
      L = mid;
  }
  printf("%0.14f\n", R);
  return 0;
}
