A Relic Discovery
水。
1 #include <bits/stdc++.h> 2 using namespace std; 3 4 int t, n; 5 6 int main() 7 { 8 scanf("%d", &t); 9 while (t--) 10 { 11 scanf("%d", &n); 12 int res = 0; 13 for (int i = 1, a, b; i <= n; ++i) 14 { 15 scanf("%d%d", &a, &b); 16 res += a * b; 17 } 18 printf("%d\n", res); 19 } 20 return 0; 21 }