In a shape(rectangle or square ) with width n and length m, I want to know how many shapes there are with width and length a and b. I also want to know the remaining forms.
For example, in the figure below, whose width and length are 10cm x 10cm, a shape with a width and length of 3 x 3 will be output as below:
9 items 3cm in 3cm (called G1)
3 items 1cm in 3cm (called G2)
3 items 3cm in 1cm (called G3)
And a 1cm in 1cm item (called G4)
I'm a developer. I don't calculate this problem. (I don't know what tag to choose. plz update my tags. )

I published my solution and algorithm implementation in Javascript for your problem: https://github.com/BaseMax/ShapesAlgorithm
The online demo is available at the following link: https://basemax.github.io/ShapesAlgorithm/demo.html
Source code: