Topcoder SRM practice problems solved in C++