Computer Programming Contest Preparation

ToolBox - Source for: 103/10300/10300.cpp



/home/toolbox/public_html/solutions/103/10300/10300.cpp
    1 #include <iostream>
    2 
    3 int main()
    4 {
    5     int cases;
    6     int farmers;
    7     std::cin >> cases;
    8     while(cases > 0)
    9         {
   10             std::cin >> farmers;
   11             unsigned long long int total = 0;
   12             while(farmers > 0)
   13                 {
   14                     unsigned long long int size, animals, environment;
   15                     std::cin >> size;
   16                     std::cin >> animals;
   17                     std::cin >> environment;
   18                     total += size * environment;
   19                     farmers--;
   20                 }
   21             std::cout << total << std::endl;
   22             cases--;
   23         }
   24     return 0;
   25 }
   26