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

[백준/파이썬] 32369번 양파 실험

by 현장 2024. 9. 29.

-Code

n, a, b = map(int, input().split())
praise, blame = 1, 1

for _ in range(n):
    praise += a
    blame += b

    if praise < blame:
        praise, blame = blame, praise

    if praise == blame:
        blame -= 1

print(praise, blame)