Well to solve this you will need a graph.
Step 1: take the first example and count how many squares each line is.
Step 2: you should have 3 lines with 3 amounts of blocks per line.
Step 3: Let’s say the line going vertically is 5 blocks long. So use a factor of 2 on 5.
(If you need help with that just reply to this dearie)