Fading Wind

This commit is contained in:
2023-06-24 22:05:19 +02:00
parent 55b1e5cfe5
commit 43c7f74a38

17
fadingwind.py Normal file
View File

@@ -0,0 +1,17 @@
h, k, v, s = map(int, input().split())
travel = 0
while h > 0:
v += s
v -= max(1, v // 10)
if v >= k:
h += 1
if 0 < v < k:
h -= 1
if h == 0:
v = 0
if v <= 0:
h, v = 0, 0
travel += v
if s > 0:
s -= 1
print(travel)