#include <bits/stdc++.h>
using namespace std;
const int N = 60005;
const double eps = 1e-6;
double a[N], b[N];
int n;
bool check(double x) {
  double l = a[0] - b[0] * x;
  double r = a[0] + b[0] * x;
  for (int i = 1; i < n; ++i) {
    if ((a[i] - b[i] * x) > r || (a[i] + b[i] * x) < l) {
      return false;
    }
    if ((a[i] - b[i] * x) > l) l = a[i] - b[i] * x;
    if ((a[i] + b[i] * x) < r) r = a[i] + b[i] * x;
  }
  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", &b[i]);
  }
  double l = 0, r = 1e9;
  while (r - l > eps) {
    double mid = (l + r) / 2;
    if (check(mid))
      r = mid;
    else
      l = mid;
  }
  printf("%.12lf", l);
  return 0;
}
