Solution to the problem number 10300 of UVA - 10300.

Any questions do not hesitate to contact.

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int cases,num,a,b,c;
    cin>>cases;
    while(cases--)
    {
        int res=0;
        cin>>num;
        while(num--)
        {
            cin>>a>>b>>c;
            res+=a*c;
        }
        cout<<res<<endl;
    }
return 0;
}

Don't miss anything.

Keep in touch with Isaac Lozano Osorio!