#include <bits/stdc++.h>
using namespace std;
double time(int x[], int v[], int, double);
int main(void) {
  int n;
  cin >> n;
  int x[n], v[n];
  for (int i = 0; i < n; ++i) cin >> x[i];
  for (int i = 0; i < n; ++i) cin >> v[i];
  double first, last;
  last = 0;
  first = x[0];
  for (int i = 0; i < n; ++i) {
    if (x[i] > last) last = x[i];
    if (x[i] < first) first = x[i];
  }
  while (last - first > 0.000001) {
    double mid, time_mid, proz;
    mid = (first + last) / 2;
    time_mid = time(x, v, n, mid);
    proz = time(x, v, n, mid + 0.000001);
    if (proz > time_mid)
      last = mid;
    else
      first = mid;
  }
  double kek;
  kek = time(x, v, n, first);
  printf("%.6lf", time(x, v, n, first));
  return 0;
}
double time(int x[], int v[], int n, double num) {
  double sum = 0;
  double maximum = 0;
  for (int i = 0; i < n; ++i) {
    double X, V;
    X = x[i];
    V = v[i];
    sum = (max(X - num, num - X)) / V;
    if (sum > maximum) maximum = sum;
  }
  return maximum;
}
