LYM20114 @ 2022-07-28 16:38:41
#include <iostream>
#include <iomanip>
using namespace std;
int n,v[105];
double f[105][2];
double dp(int N,bool ismar){
if(N == n && !ismar)
return 1;
else if(N == n && ismar)
return 1 * 1.0 / v[n];
if(f[N][ismar] > 0)
return f[N][ismar];
if(ismar){
return f[N][ismar] = max(dp(N + 1,1),dp(N + 1,0) * (100 * 1.0 / v[N]));
}
else
return f[N][ismar] = max(dp(N + 1,1) * v[N] * 1.0 / 100,dp(N + 1,0));
}
int main(){
cin >> n;
for(int i = 1;i <= n;i++) cin >> v[i];
double ans = dp(1,0) * 100;
cout << fixed << setprecision(2) << ans << endl;
return 0;
}