class Solution(object):
def multiply(self, A):
"""
:type A: List[int]
:rtype: List[int]
"""
n=len(A)
if n==0:
return []
def make(x,y):
# 左闭右闭
number=1
for index in range(x,y+1):
number*=A[index]
return number
als=[]
for x in range(n):
als.append((make(0,x-1),make(x+1,n-1)))
# print(als)
res=[]
for x in range(n):
res.append(als[x][0]*als[x][1])
return res