Need help in a counting problem
https://codeforces.com/gym/101628/problem/GHow to solve it?
CodeChef Starters 132 Solution Discussion