[백준/Python] 22864번 피로도

divele·2023년 9월 21일

백준

목록 보기
16/17


정답

a,b,c,cut_m = map(int, input().split())
now_m = 0
count = 0
for _ in range(24):
  if now_m+a <= cut_m:
    now_m += a
    count += 1
  else:
    now_m -= c
    if now_m < 0:
        now_m = 0
print(count*b)
profile
https://solved.ac/profile/divele

0개의 댓글