uva10300

#include
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>


using namespace std;


int main(){
    #ifdef LOCAL
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    #endif
int t, n1;
long long s, n, a, sum;
while(scanf("%d", &t) != EOF){
        while(t--){
            scanf("%d", &n1);
            sum = 0;
            while(n1--){
                scanf("%lld%lld%lld", &s, &n, &a);
                sum+=s*a;
            }
            printf("%lld\n", sum);
        }
}
return 0;
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章