Premium C++ coding problem - MPGH