就能A掉这题(
#include<bits/stdc++.h>
#define N 1000005
#define int long long
using namespace std;
int n,a[N];
bool check(double x){
for(int i=1,k;i<=n;i++){
k=a[i]/x;
while(ceil(x*k)<a[i]) k++;
while(ceil(x*k)>a[i]) k--;
if(ceil(x*k)!=a[i]) return false;
}return true;
}
signed main(){
ios::sync_with_stdio(false);
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i],a[i]++;
for(double i=200;i>=0;i-=0.000005){
if(check(i)){
cout<<fixed<<setprecision(7)<<i<<endl;
return 0;
}
}
}
请求加强数据。