← Back to List

1703번: 생장점 ↗

Solutions

Python 3
189 B | 189 chars
while True:
    a=list(map(int,input().split()))
    if a==[0]:
        break
    a=a[1:]
    S=a[0]-a[1]
    for i in range(2,len(a),2):
        S*=a[i]
        S-=a[i+1]
    print(S)