백준 9325번: 얼마?

danbibibi·2021년 9월 25일

문제

문제 바로가기> 백준 9325번: 얼마?

풀이

간단한 사칙연산이다.

def solution():
    import sys
    T = int(input())
    for i in range(T):
        s = int(sys.stdin.readline().rstrip())
        n = int(sys.stdin.readline().rstrip())
        for j in range(n):
            q, p = map(int, sys.stdin.readline().rstrip().split())
            s+=q*p
        print(s)
solution()
profile
블로그 이전) https://danbibibi.tistory.com

0개의 댓글