题解 | 汽水瓶
汽水瓶
https://www.nowcoder.com/practice/fe298c55694f4ed39e256170ff2c205f
import sys
for line in sys.stdin:
a = line.split()
# print(int(a[0]) + int(a[1]))
null = int(a[0])
total = 0
if null == 0:
break
while null > 1:
num = null // 3
null = num + null % 3
if null == 2: # 只有还剩两个空瓶的时候才能借一个,刚好满3个换一瓶汽水,喝完还给老板一个空瓶
null += 1
total += num
print(total)

