#include<bits/stdc++.h>
using namespace std;
const long double pi=2*acos(-1.0);
const long double eps=1e-8;
long double Pow(long double x,int i){
long double ret=1.0;
while(i--){
ret*=x;
}
return ret;
}
int main(){
int t;
cin>>t;
for(int z=1;z<=t;z++){
long long int n,sl,st;
long double a,b;
cin>>n;
long long arr[n+1],m[2*n+1];
for(int i=n;i>=0;i--){
cin>>arr[i];
}
cin>>a>>b>>sl>>st;
long double y[st+1];
long double d=(b-a)/(long double)(st);
for(int i=0;i<=st;i++){
long double x=a+d*(long double)(i);
y[i]=0;
for(int j=0;j<=n;j++){
y[i]+=(Pow(x,j)*(long double)(arr[j]));
}
//y[i]=fabs(y[i]);
}
long double fa=0,th=(pi/(long double)(sl));
for(int i=0;i<st;i++){
long double aa=min(y[i],y[i+1]);
long double bb=max(y[i],y[i+1]);
long double h;
if(aa!=bb){
h=bb*d/(bb-aa);
}
aa=((long double)(sl)*aa*aa*sin(th))/2;
bb=((long double)(sl)*bb*bb*sin(th))/2;
if((bb-aa)<eps){
fa+=(aa*d);
continue;
}
long double x=(bb*h)/3;
long double xx=(aa*(h-d))/3;
fa+=(x-xx);
}
memset(m,0,sizeof(m));
for(int i=0;i<=n;i++){
for(int j=0;j<=n;j++){
m[i+j]+=(arr[i]*arr[j]);
}
}
long double tv=0;
for(int i=0;i<=(n*2);i++){
tv+=(m[i]*((Pow(b,i+1)-Pow(a,i+1))/(long double)(i+1)));
}
tv*=pi;
tv/=2.0;
printf("Case %d: %.4Lf\n",z,((tv-fa)/tv)*100.0);
}
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKY29uc3QgbG9uZyBkb3VibGUgcGk9MiphY29zKC0xLjApOwpjb25zdCBsb25nIGRvdWJsZSBlcHM9MWUtODsKbG9uZyBkb3VibGUgUG93KGxvbmcgZG91YmxlIHgsaW50IGkpewoJbG9uZyBkb3VibGUgcmV0PTEuMDsKCXdoaWxlKGktLSl7CgkJcmV0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