Codeforces, SPOJ, and HackerRank solutions