redone codeeval2 in C++