結果 : codeforces solution in python