백준문제풀이/기본수학1

2869 달팽이는 올라가고 싶다

포비용 2022. 12. 27.
import sys

sys.stdin = open("input.txt","rt")

up,down,v = map(int, sys.stdin.readline().split())

total_v = 0

cnt = 0


while True:

    cnt += 1

    total_v += up

    if total_v >= v:
        break

    else:
        total_v -= down


print(cnt)

---------------------
# 답


import sys
import math

sys.stdin = open("input.txt","rt")

a,b,v = map(int, sys.stdin.readline().split())

total_day = math.ceil((v-b)/(a-b))


print(total_day)

'백준문제풀이 > 기본수학1' 카테고리의 다른 글

2775  (0) 2022.12.30
10250  (0) 2022.12.28
1193 -- 다시풀이  (0) 2022.12.26
2292  (0) 2022.12.26
1712 -- 다시풀어보기  (0) 2022.12.24

댓글