#include<iostream>

using namespace std;

int main(){

    int n;
    int f;
    long long int x[4];

    while(cin >> n)
        while(n--){

            cin >> f;
            x[3] = 0;

            while(f--){
                cin >> x[0] >> x[1] >> x[2];
                x[3] += x[0] * x[2];
            }
            cout << x[3] << endl;
        }

    return 0;
}
 

arrow
arrow
    全站熱搜

    大神(偽) 發表在 痞客邦 留言(0) 人氣()