#include <bits/stdc++.h>
using namespace std;
int n;
int a[60050];
int v[60050];
int minn = 1000000001.00, maxx = 0.00;
double max_time = 0.00;
int max_time_pos = 0;
bool check(double mid) {
  max_time = 0.00;
  max_time_pos = 0;
  for (int i = 1; i <= n; i++) {
    if (max_time < abs(mid - a[i]) / v[i]) {
      max_time = abs(mid - a[i]) / v[i];
      max_time_pos = a[i];
    }
  }
  if (max_time_pos > mid)
    return true;
  else
    return false;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    minn = min(minn, a[i]);
    maxx = max(maxx, a[i]);
  }
  for (int i = 1; i <= n; i++) cin >> v[i];
  double l = minn - 1.00, r = maxx + 1.00, mid = 0.00;
  int tot = 0;
  while (tot <= 100) {
    mid = (l + r) / 2;
    if (check(mid))
      l = mid;
    else
      r = mid;
    tot++;
  }
  max_time = 0.00;
  for (int i = 1; i <= n; i++) max_time = max(max_time, abs(l - a[i]) / v[i]);
  cout << fixed << setprecision(12) << max_time << endl;
  return 0;
}
