#include <bits/stdc++.h>
using namespace std;
const long long M = 998244353;
const int N = 2 * 1e5 + 5;
const long long INF = 1e18;
const double EPS = 1e-6;
long long l, r, n;
pair<double, double> x[N];
double time(double m) {
  double ans = double(0);
  for (int i = 1; i <= n; i++) {
    ans = max(ans, double(abs(x[i].first - m) / double(x[i].second)));
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  double maxi = 1e9, mini = 0;
  for (int i = 1; i <= n; i++) {
    cin >> x[i].first;
    maxi = max(maxi, x[i].first);
    mini = min(mini, x[i].first);
  }
  for (int i = 1; i <= n; i++) {
    cin >> x[i].second;
  }
  double l = mini, r = maxi;
  while (r - l > EPS) {
    double mid1 = l + (r - l) / 3;
    double mid2 = r - (r - l) / 3;
    if (time(mid1) > time(mid2)) {
      l = mid1;
    } else
      r = mid2;
  }
  cout << fixed << setprecision(10) << time(r);
  return 0;
}
