#include <bits/stdc++.h>
using namespace std;
const int N = 2e5, MOD = 1e9 + 7;
const long long INF = 1e12;
long double a[N], b[N];
int n;
long double prove(long double q) {
  long double ans = 0;
  for (int i = 0; i < n; i++) ans = max(ans, (fabs(a[i] - q) / b[i]));
  return ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  long double l = 0, r = 1e9 + 1;
  for (int i = 0; i < 500; i++) {
    long double m1 = l + (r - l) / 3.0;
    long double m2 = r - (r - l) / 3.0;
    if (prove(m1) >= prove(m2))
      l = m1;
    else
      r = m2;
  }
  cout << setprecision(10) << fixed;
  cout << prove(l) << endl;
  return 0;
}
