题解 | #称砝码#
称砝码
https://www.nowcoder.com/practice/f9a4c19050fc477e9e27eb75f3bfd49c
while True: try: n=int(input()) mx=input().split(' ') xx=input().split(' ') li,li_ba=[0],[0] for m,x in zip(mx,xx): for i in range(1,int(x)+1): for j in li: li_ba.append(j+int(m)*i) li=list(set(li_ba)) li_ba=list(set(li_ba)) print(len(li)) except: break