C++ codes for SPOJ problems