백준 15340번: Sim Card #Python

ColorlessDia·2025년 10월 9일

algorithm/baekjoon

목록 보기
690/807
import sys

input = sys.stdin.readline

while True:
    C, D = map(int, input().split())

    if C == D == 0:
        break

    P1 = (C * 30) + (D * 40)
    P2 = (C * 35) + (D * 30)
    P3 = (C * 40) + (D * 20)

    print(min(P1, P2, P3))

0개의 댓글