The Blocks problem from UVa Online Judge (100) implemented in C++ using classes