#include<stdio.h>
main(){
int testnum=1 ,i=0,b=0,farmernum, a, n, g;
long int ans;
while(scanf("%d", &testnum)!=EOF)
while(i<testnum)
{
ans=0;b=0;
scanf("%d",&farmernum);
while(b<farmernum)
{
scanf("%d %d %d", &a, &n, &g);
ans+=(a*g);
b++;
}
printf("%ld\n", ans);
i++;
}
}
範例過了..就是不知道wa在那裡
覺得有點怪怪的..可是就是看不出來錯在那..=.="