codeeval 47,53,71,79 in C++