a very simple problem
//============================================================================
// Name : 10300.cpp
// Author : benbendog
// DATE : 2010/12/11
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
/*
* PROBLEM : given many a,b,c , calculate sum += (a/b)*b*c = a*c;
* SOLUTION: do as the problem is stated
*/
int main() {
int cas;
cin>>cas;
while(cas--)
{
int num;
long long sum = 0;
cin>>num;
for(int i = 0 ; i <num ; ++i)
{
int a,b,c;
cin>>a>>b>>c;
sum+=a*c;
}
cout<<sum<<endl;
}
return 0;
}
留言列表