n,a,b=map(int,input().split()) S=1 for i in range(n+1): S*=i+1 x=0 for i in range(n+1): k=int(input()) x+=S*k*(b**(i+1)-a**(i+1))//(i+1) print(x//S)