#include <bits/stdc++.h>
using namespace std;
const double eps = 0.000001;
const int maxn = 60010;
double check(double x, int n, double a[], double b[]) {
  double ans = 0;
  for (int i = 0; i < n; i++) ans = max(ans, fabs(x - a[i]) / b[i]);
  return ans;
}
int main() {
  int n;
  double a[maxn], b[maxn];
  double mmin = 1.0 * 0x3f3f3f3f, mmax = -1.0 * 0x3f3f3f3f;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lf", &a[i]);
    mmin = min(mmin, a[i]);
    mmax = max(mmax, a[i]);
  }
  for (int i = 0; i < n; i++) scanf("%lf", &b[i]);
  double l = mmin, r = mmax;
  while (l + eps < r) {
    double mid = (l + r) / 2;
    double mmid = (mid + r) / 2;
    if (check(mid, n, a, b) > check(mmid, n, a, b))
      l = mid;
    else
      r = mmid;
  }
  printf("%.12lf\n", check(r, n, a, b));
  return 0;
}
