First algorithm coding and some DP on Codeforces.