#include <bits/stdc++.h>
using namespace std;
double a[60005], v[60005];
int n;
double l, r;
bool check(double mid) {
  double le = 0, ri = 0;
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      le = a[i] - v[i] * mid;
      ri = a[i] + v[i] * mid;
    } else {
      double ll = a[i] - v[i] * mid;
      double rr = a[i] + v[i] * mid;
      if (ll > ri || rr < le) {
        return false;
      }
      le = max(ll, le);
      ri = min(rr, ri);
    }
  }
  return true;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &a[i]);
  for (int i = 0; i < n; i++) scanf("%lf", &v[i]);
  double l = 0, r = 1e9;
  while (r - l > 1e-6) {
    double mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  printf("%.12lf\n", r);
}
