Pabon_SEC

Ecological premium

Sep 3rd, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     long long int t,n,a,b,c,d,sum;
  5.     scanf("%lld",&t);
  6.     while(t--)
  7.     {
  8.         sum=0;
  9.         scanf("%lld",&n);
  10.         while(n--)
  11.         {
  12.             scanf("%lld%lld%lld",&a,&b,&c);
  13.             d=a*c;
  14.             sum=sum+d;
  15.         }
  16.         printf("%lld\n",sum);
  17.     }
  18.     return 0;
  19. }
Add Comment
Please, Sign In to add comment