PS:推算。。。数组如果开得不够大也会超时。。。
代码:
#include "stdio.h"
double cal(int t,double a[]);
int main(){
double a0,an1,c[],sum,k;
int i,n,b;
while(~scanf("%d",&n)){
scanf("%lf%lf",&a0,&an1);
for(i=;i<=n;i++)
scanf("%lf",&c[i]);
sum=(double)n/(double)(n+)*a0+1.0/(n+)*an1;
k=(double)n*2.0;
for(i=;i<=n;i++){
sum-=k/(n+)*c[i];
k-=2.0;
}
printf("%.2lf\n",sum);
}
return ;
}