Problem - 1277D - Codeforces