[백준/Python] 10984 - 내 학점을 구해줘

orangesnail·2025년 3월 8일

백준

목록 보기
58/169


https://www.acmicpc.net/problem/10984


t = int(input())

for _ in range(t):  # 학기
    n = int(input())
    total = 0
    grade = 0

    for _ in range(n):  # 과목
        c, g = input().split()
        c, g = int(c), float(g)

        total += c
        grade += c * g

    grade /= total
    print(f"{total} {grade:.1f}")
profile
초보입니다. 피드백 환영합니다 😗

0개의 댓글