# Math Help - Rectangle question

1. ## Rectangle question

Consider a rectangle $l$ units long, and $w$ units wide and the $lw$ unit squares found in it. A diagonal is drawn from one corner to the opposite. The diagonal cuts through certain unit squares. Find in terms of $l$ and $w$ the number of unit squares that are cut through.

2. Case1:
If l and w don't have a common factor, then the number of squares cut=l+w-1

Case 2:
If l and w have a common factor, let gcd be m
then no. of squares cut=l + w -m