#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
int solve();
int main() {
  solve();
  return 0;
}
const int dd = (int)6e4 + 7;
const int inf = (int)1e9 + 7;
struct st {
  int x, v;
} A[dd];
int n;
double get(double X) {
  double ans = 0;
  for (int i = 0; i < n; ++i) ans = max(ans, abs(A[i].x - X) / A[i].v);
  return ans;
}
int solve() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &A[i].x);
  for (int i = 0; i < n; ++i) scanf("%d", &A[i].v);
  double l = 1, r = 1e9;
  for (int it = 0; it < 200; ++it) {
    double m1 = l + (r - l) / 3;
    double m2 = r - (r - l) / 3;
    if (get(m1) > get(m2))
      l = m1;
    else
      r = m2;
  }
  printf("%.10f", get(l));
  return 0;
}
