题解 | #称砝码#
categroy = int(input()) weights = list(map(int,input().split())) counts = list(map(int,input().split())) ls = {0} for weight,count in zip(weights,counts): for i in range(count): ls = ls|{weight+j for j in ls} print(len(ls)) print(len(ls))