solved codeforces problem