n,a,b=map(int,input().split()) f=0 c=11*9*8*7*5 for i in range(n+1): k=int(input()) s=b**(i+1)*k*c//(i+1) t=a**(i+1)*k*c//(i+1) f=f+s-t print(f//c)