The editorial of problem ABC370G: Divisible by 3 from last Atcoder Beginner Contest contains an interesting subproblem : How to count the number of arrays of length $$$L$$$ where product of all elements is $$$P$$$? The editorial mentions that this is a good exercise for Blue/Yellow coders, so I created a blog talking about this idea.
https://cfstep.com/training/tutorials/math/count-arrays-with-fixed-product/
To help you verify correctness, I also created a practice problem : https://codeforces.me/group/7Dn3ObOpau/contest/549784
The problems are untested, if you see any issues with the model solution, do let me know in the comments.