My solution to codeforces tasks.