[BOJ] 2869. ๋‹ฌํŒฝ์ด๋Š” ์˜ฌ๋ผ๊ฐ€๊ณ  ์‹ถ๋‹ค

๋ฌธ์ œ

Baekjoon Online Judge
Baekjoon Online Judge

BOJ #2869. ๋‹ฌํŒฝ์ด๋Š” ์˜ฌ๋ผ๊ฐ€๊ณ  ์‹ถ๋‹ค

SOLVED.AC Silver V


Python ์ฝ”๋“œ

* sys.stdin.readline()์€ input()๊ณผ ๊ฑฐ์˜ ๋น„์Šทํ•œ ํšจ๊ณผ๋ฅผ ๋‚ด์ง€๋งŒ, ๋” ๋น ๋ฅด๋ฏ€๋กœ ์‹œ๊ฐ„ ์ œํ•œ์ด ์žˆ๋Š” ๋ณธ ๋ฌธ์ œ์— ๋” ์ ํ•ฉํ•˜๋‹ค.

import sys
a,b,v=map(int,sys.stdin.readline().split(" "))
k=(v-a)%(a-b)
ans=(v-a)/(a-b)
if k==0:
    print(int(ans)+1)
else:
    print(int(ans)+2)