In my experience architects generally avoid number theory.
Let's called the shared wall
![s](https://img.qammunity.org/2019/formulas/mathematics/college/whs484g53j2g6yxt5zxzxiyt5qdk13a5th.png)
. The area is width times height, so the other walls are
![104/s](https://img.qammunity.org/2019/formulas/mathematics/middle-school/ub66nvzbbprfai4dq95qrmgej969sh8y3b.png)
and
![130/s](https://img.qammunity.org/2019/formulas/mathematics/middle-school/9qjg3h739ut0dw0d5lj5deuj87zfgvxe16.png)
. We want the biggest s that gives integer quotients; that would be the greatest common factor of 104 and 130.
![104 = 2^3 13^1](https://img.qammunity.org/2019/formulas/mathematics/middle-school/hjccl5fxs8mwdrugsu3tarcc5n93102ayj.png)
![140 = 2^1 5^1 13^1](https://img.qammunity.org/2019/formulas/mathematics/middle-school/v571erpus4qfmzzt95073df4w5hpx2uokw.png)
Greatest common factor and largest shared wall,
![w = 2 * 13 = 26](https://img.qammunity.org/2019/formulas/mathematics/middle-school/pkowz55elktux5dieogc392x8tbdg0zl8c.png)
That's None of the Above, though 26x4 and 26x5 rooms are pretty goofy, probably why architects don't worry about number theory.