#include <bits/stdc++.h>
using namespace std;
long long b[60005], c[60005];
signed main() {
  long long a;
  scanf("%lld", &a);
  long long MIN = LLONG_MAX / 3, MAX = 0;
  for (long long d = 0; d < a; d++) {
    scanf("%lld", &b[d]);
    MIN = min(MIN, b[d]);
    MAX = max(MAX, b[d]);
  }
  for (long long d = 0; d < a; d++) {
    scanf("%lld", &c[d]);
  }
  double s = MIN, g = MAX;
  for (long long i = 0; i < 10000; i++) {
    double k = (s + g) / 2;
    double n = -1;
    bool t = false;
    for (long long j = 0; j < a; j++) {
      double m = abs(k - b[j]) / (double)c[j];
      if (m > n) {
        if (b[j] > k)
          t = true;
        else
          t = false;
        n = m;
      }
    }
    if (i == 9999) {
      printf("%.15lf\n", n);
    }
    if (t)
      s = k;
    else
      g = k;
  }
}
