#include<bits/stdc++.h>
using namespace std;

typedef pair<double, double> data;
vector<data> input;
double s;
int n;

double getTime(double x, double y){
    double t = (x - input[0].first)/input[0].second * 1.0;
    t = 0;
    for(int i = 0; i < n; ++i){
        if(input[i].first < x){
            t = max(t, (x - input[i].first)/input[i].second * 1.0);
        }else if(input[i].first > y){
            t = max(t, (input[i].first - y)/input[i].second * 1.0);
        }
    }

    return t;
}

bool cmp(data d1, data d2){
    return d1.second < d2.second;
}

int main(){
    cin >> n;
    double t2, t1, s, t = 0;
    double l, r, m, temp;
    cin >> temp;
    input.push_back(make_pair(temp,0));
    l = temp;
    r = temp;
    for(int i = 1; i < n; ++i){
        cin >> temp;
        l = min(temp, l);
        r = max(temp, r);
        input.push_back(make_pair(temp,0));
    }

    for(int i = 0; i < n; ++i){
        cin >> input[i].second;
    }

    while(l != r ){
        m = (l + r)/2;
        if(l == m) break;
        t1 = getTime(m, r);
        t2 = getTime(l, m);
        t = min(t1, t2);
        //cout << t1 << " " << t2 << endl;
        if(max(t1, t2) - min(t1, t2) < 0.00000009) break;
        if(t1 > t2) r = m;
        else l = m;
    }
    //cout << l << " " << r;
    printf("%.9f", t);
    //for(int i = 0; i < input.size(); ++i) cout << input[i].first << " " << input[i].second << endl;


}
