Computer Programming Contest Preparation

ToolBox - Source for: 107/10790/10790.cpp



/home/toolbox/public_html/solutions/107/10790/10790.cpp
    1 #include <iostream>
    2 
    3 int main()
    4 {
    5     int tries = 1;
    6     while(1)
    7         {
    8             unsigned long long m, n;
    9             std::cin >> m;
   10             std::cin >> n;
   11             if(m == 0 && n == 0)
   12                 {
   13                     break;
   14                 }
   15             unsigned long long total = (m*(m-1)*n*(n-1));
   16             /*std::cout << "m*(m-1) = " << m*(m-1) << std::endl;
   17             std::cout << "n*(n-1) = " << n*(n-1) << std::endl;
   18             std::cout << "m*(m-1)*n*(n-1) = " << m*(m-1)*n*(n-1) << std::endl;*/
   19             total = (unsigned long long)(total/((unsigned long long)4));
   20             std::cout << "Case " << tries << ": " << total << std::endl;
   21             tries++;
   22         }
   23     return 0;
   24 }
   25