Need help in a counting problem
https://codeforces.me/gym/101628/problem/GHow to solve it?
ICPC NA North Central and South Division