I wasn't really sure how to phrase the question nor know how I should tag it.

Lets say I have a piece of paper (42x25) that I need to cut into squares (the size and number of the squares do not matter). How many pieces can I cut out with having little to no remainder?

I did this problem by following an art book's instructions with the dimensions of 21x12.5 cm instead of 42x25 cm and doing these steps.

1. lw = R ; 21 - 12.5 = 8.5
2. R/2 = length of segment ; 8.5/2 = 4.25
3. Then I measured out 4.25 cm along the edges of a paper until I reached 5 segments on the length and 3 segments on the width.
4. Then I divided the length and width by their respective segments. And found out their lengths were around 4.2 cm

What I am asking:
What is the formula to find the common multiple when multiplied with a whole number it roughly equals to given lengths? The only thing I can this of is that if:

x = the segment length

y = the number of segments of the length of an edge1

z = the number of segments of the length of an edge2

Then

xy ~= Edge1

xz ~= Edge2

But I can't figure out how to actually solve it since there are two variables.