Problem - 587B - Codeforces