Algorithm/ct/l2/15-小红无敌.py

20 lines
254 B
Python
Raw Permalink Normal View History

2022-10-28 02:37:25 +08:00
import io
import sys
sys.stdin = io.StringIO('''2 3 1 3''') # 26
a, h, b, k = map(int, input().split())
c = 0
while h > 0 and k > 0:
c += a
c += b
h -= b
k -= a
if h > 0 > k:
c += a * 10
elif h <= 0 < k:
c += b * 10
print(c)