We know a rectangle has two congruent pairs of sides.
So, we are trying to find what multiplies to 20 and adds to 9 (half of 18 because we are only counting one pair).
x*y = 20
x + y = 9
The factors of 20 are 1,2,4,5,10,20 and two of those add up to 9.
When we look carefully we find those two are 4 and 5.
Sooo the dimensions of the rectangle are 4 and 5.
(Tell me if anything is wrong here)
I'm gonna take a guess here and say that your diagram meant to look like this:
This can be done with a simple counting principle:
( I actually don't know how to do this that well so I'm taking a wild guess)
From the first to the second we have 3 possible ways.
From the second to the third we also have 3 possible ways.
From the third to the fourth we again have 3 possible ways.
SO, my wild guess says the answer is 27 (but it was a wild guess so check it.