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

[백준/파이썬] 25881번 Electric Bill

by 현장 2022. 10. 26.

-Code

t, o = map(int, input().split())
for _ in range(int(input())):
    e = int(input())
    res = 0
    if e > 1000:
        res += t * 1000 + (e - 1000) * o
    else:
        res += t * e
    print(e, res)