#include <bits/stdc++.h>
using namespace std;
int n;
double x[60001];
double v[60001];
double CountTime(double x0) {
  double time = 0;
  for (int i = 0; i < n; i++) time = max(time, (abs(x[i] - x0) / (v[i])));
  return time;
}
double ternary() {
  double left = 1;
  double right = 1000000002;
  for (int i = 0; i < 500; i++) {
    double l = left + (right - left) / 3ll;
    double r = right - (right - left) / 3ll;
    if (CountTime(l) >= CountTime(r))
      left = l;
    else
      right = r;
  }
  return CountTime(left);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < n; i++) cin >> v[i];
  cout << fixed << setprecision(8);
  cout << ternary();
  return 0;
}
