n = int(input())
for i in range(n):
car = int(input())
opt = int(input())
c = 0
for j in range(opt):
a, b = map(int, input().split())
c += a*b
print(car+c)
'파이썬 > 백준' 카테고리의 다른 글
5522번 : 카드 게임 (0) | 2022.06.12 |
---|---|
2010번 : 플러그 (0) | 2022.06.10 |
2523번: 별찍기-13 (0) | 2022.06.08 |
2522번: 별찍기-12 (0) | 2022.06.07 |
2444번: 별찍기-7 (0) | 2022.06.06 |