python 100分
nums=list(map(int,input().split(" ")))
arr=list(map(int,input().split(" ")))
n=nums[0]
m=nums[1]
ci=[1]
for i in arr:
ci.append(ci[-1]*i)
mci=[0]
for i in range(1,n+1):
mci.append(m%ci[i])
for i in range(1,n+1):
mci[i]=mci[i]-mci[i-1]
for i in range(1,n+1):
mci[i]=int(mci[i]/ci[i-1])
mci=mci[1:n+2]
print(*mci)