Решить задачу с Codeforces на Microsoft Visual C++ 2017
https://codeforces.com/group/I6kxOPonlf/contest/239943/problem/B