三分模板
#include <cstdio>
#include <cstring>
#include <cmath>
#define eps 1e-7
double a[20];
int N;
double l,r,ans;
inline double f(double x){
double sum = a[N];
for(register int i=N-1;i>=0;--i){
sum = sum*x + a[i];
}
return sum;
}
int main(){
scanf("%d%lf%lf",&N,&l,&r);
int x;
for(register int i=N;i>=0;--i){
scanf("%lf",&a[i]);
}
while(fabs(r-l)>eps){
double mid_1 = l+(r-l)/3.0000001;
double mid_2 = r-(r-l)/3.0000001;
if(f(mid_1)>f(mid_2))r = mid_2;
else l = mid_1;
}
printf("%.5lf",l);
return 0;
}