poj-4045.cpp Accepted and Described