#include <bits/stdc++.h>
using namespace std;
const int N = 60005;
int n, v[N], x[N], ma = INT_MIN, mi = INT_MAX;
double ans;
double cal(double tx) {
  double time = 0;
  for (int i = 1; i <= n; i++) {
    double temp = abs(tx - x[i]) * 1.0 / v[i];
    time = max(time, temp);
  }
  return time;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> v[i];
  }
  double t1, t2;
  t1 = cal(1);
  t2 = cal(1 + 0.000001);
  if (t2 >= t1) {
    cout << t1 << "\n";
    return 0;
  }
  t1 = cal(1000000000 - 0.000001);
  t2 = cal(1000000000);
  if (t1 >= t2) {
    cout << t2 << "\n";
    return 0;
  }
  double low = 1, high = 1000000000 - 1, mid;
  double tcur, tnex, tpre;
  while (low <= high) {
    mid = (low + high) / 2;
    tcur = cal(mid);
    tpre = cal(mid - 0.000001);
    tnex = cal(mid + 0.000001);
    if (tpre > tcur && tcur > tnex) {
      low = mid + 0.000001;
    } else if (tpre < tcur && tcur < tnex) {
      high = mid - 0.000001;
    } else {
      ans = tcur;
      break;
    }
  }
  cout << fixed << setprecision(6) << tcur;
}
