#include <iostream>

//problem 9:
//find the product of a + b + c = 1000 where a < b < c && a^2 + b^2 = c^2


int main()
{
    int a , b , c;

    for( int c = 997; c > 3; --c )
    {
        for( int b = 1000 - c - 1; b > 1; --b )
        {
            a = 1000 - b - c;
            if( a * a + b * b == c * c && b > a )
            {
                std::cout << "Result: " << a * b * c << std::endl;
            }
        }
    }
}