木工老王的春天:魔法学徒的秘密

for i from 1 to n:
if condition[i]:
magic_power += weight[i]