본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 5101번 Sequences

by 현장 2023. 2. 18.

-Code

while 1:
    a, b, c = map(int, input().split())
    if a == b == c == 0:
        break

    if (c - a) % b == 0 and (c - a) // b + 1 > 0:
        print((c - a) // b + 1)
    else:
        print('X')