Wednesday, October 26, 2011

UVa Problem: Ecological Premium(10300)

//This C++ program is the solution to
//the problem put up on the UVa online judge
//website. The problem id is 10300
//
//Question: Ecological Premium


#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int f,i,ar[n],j;
int a,b,c,s=0;
for(i=0;i<n;i++)
{
cin>>f;
s=0;
for(j=1;j<=f;j++)
{
cin>>a>>b>>c;
s=s+a*c;
}
ar[i]=s;
}

for(i=0;i<n;i++)
{
cout<<ar[i]<<"\n";
}
}

//Author of solution : Mayank Rajoria

No comments:

Post a Comment