#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <algorithm>
#include <string.h>
#include <cmath>
#define MAXN 160100
using namespace std;
int N;
int a[30];
double f[30][MAXN];

void solve(){
    for (int i=1;i<MAXN;++i)
        f[1][i]=abs(i-a[1])*1.0/a[1];
    //for (int i=1;i<MAXN;++i)
        //printf("%d %.6lf\n",i,f[1][i]);
    for (int i=2;i<=N;++i)
        for (int j=1;j<MAXN;++j){
            double m=abs(j-a[i])*1.0/a[i];
            double tmp=MAXN;
            int p=sqrt(j);
            for (int k=1;k<=p;++k)
                if (j%k==0){
                tmp=min(tmp,f[i-1][k]);
                tmp=min(tmp,f[i-1][j/k]);
            }
            f[i][j]=max(m,tmp);
        }
    double Ans=MAXN;
    for (int i=1;i<MAXN;++i)
        Ans=min(Ans,f[N][i]);
    printf("%.8lf",Ans);
}


int main(){
    //freopen("input.txt","r",stdin);
    scanf("%d",&N);
    for (int i=1;i<=N;++i)
        scanf("%d",&a[i]);
    solve();
    return 0;
}