#include<stdio.h>
int main()
{
long int i,j,k,n,a,b,c,s,m;
while(scanf("%ld",&n)==1)
{
for(i=1;i<=n;i++)
{
scanf("%ld",&m);
s=0;
for(j=1;j<=m;j++)
{
scanf("%ld%ld%ld",&a,&b,&c);
s=s+a*c;
}
printf("%ld\n",s);
}
}
return 0;
}
int main()
{
long int i,j,k,n,a,b,c,s,m;
while(scanf("%ld",&n)==1)
{
for(i=1;i<=n;i++)
{
scanf("%ld",&m);
s=0;
for(j=1;j<=m;j++)
{
scanf("%ld%ld%ld",&a,&b,&c);
s=s+a*c;
}
printf("%ld\n",s);
}
}
return 0;
}
No comments:
Post a Comment