redone codeeval in C++