practicing codeforces dp