Problem - 582B - Codeforces