def Main():
t=int(input())
cs=0
while t>0:
t-=1
cs+=1
print("Case #%d: "%(cs),end="")
[n,k,m]=map(int,input().split())
p=[]
for i in range(0,n):
x=float(input())
p.append(x)
if k==0:
print("1.0000000")
elif m==0:
print("0.0000000")
else :
g=[0]
for i in range(1,m+1):
tmp=0
for j in range(0,n):
tmp+=p[j]*(g[i-1]**j)
g.append(tmp)
print("%0.7f"%(g[m]**k))
if __name__=='__main__':
Main()
t=int(input())
cs=0
while t>0:
t-=1
cs+=1
print("Case #%d: "%(cs),end="")
[n,k,m]=map(int,input().split())
p=[]
for i in range(0,n):
x=float(input())
p.append(x)
if k==0:
print("1.0000000")
elif m==0:
print("0.0000000")
else :
g=[0]
for i in range(1,m+1):
tmp=0
for j in range(0,n):
tmp+=p[j]*(g[i-1]**j)
g.append(tmp)
print("%0.7f"%(g[m]**k))
if __name__=='__main__':
Main()
Comments
Post a Comment