Problem - 585B - Codeforces