Daffodil International University
Problem Link
//Please follow from main function#include<stdio.h>
int main()
{
long long int a,b, c, t, d, s;
while(scanf("%lld",&t)==1){
while(t--){
s=0;
scanf("%lld", &d);
while(d--){
scanf("%lld %lld %lld", &a, &b, &c);
s+=a*c;
}
printf("%lld\n", s);
}
}
return 0;
}
0 Comments