UVA 10014
#include<iostream> #include<iomanip> using namespace std; #define MAXN 10010 int main() { double c[MAXN]; double a,b; int cases,n; cin>>cases; while(cases--) { cin>>n>>a>>b; double sum=0,tmp=0; for(int i=0;i<n;i++) { cin>>c[i]; } tmp=0; for(int i=0;i<n;i++) { tmp+=c[i]; sum+=tmp; } cout.setf(ios::fixed); cout<<setprecision(2)<<((b+(n)*a-2*sum)/(n+1))<<endl; if(cases!=0) cout<<endl; } return 0; }