Problem - 558D - Codeforces