A Young week
http://petr-mitrichev.blogspot.com/2016/08/a-young-week.html
Codeforces Round 952 Solution Discussion