Solutions for codeforces, c++ version