Need help in a counting problem
https://codeforces.com/gym/101628/problem/GHow to solve it?
Codeforces Round 953 Div 2 Solution Discussion (with Jan)