#include <bits/stdc++.h>
using namespace std;
long long int n;
long long int x[60005], v[60005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (long long int i = 0; i < n; i++) cin >> x[i];
  for (long long int i = 0; i < n; i++) cin >> v[i];
  double l = 0, r = 1e9;
  while (r - l > 1e-9) {
    double mid = (l + r) / 2;
    double a = 0, b = 1e9;
    for (long long int i = 0; i < n; i++) {
      a = max(a, x[i] - v[i] * mid);
      b = min(b, x[i] + v[i] * mid);
      if (b < a) break;
    }
    if (b < a)
      l = mid;
    else
      r = mid;
  }
  printf("%.9lf\n", (l + r) / 2);
  return 0;
}
