The answer to this is -7/5
We'll use Cramer's rule for 2 equations:
ax + by = e
cx + dy = f
5x -3y = 18 a=5 b=-3 e=18
2x + 7y = -1 c=2 d=7 f=-1
denominator determinant (dn) = (a * d) - (c * b) = 5 * 7 - (2 * -3) = 41
x = [(e * d) - (f * b)] / dn
[18 * 7 - (-1 * -3)] / 41 =
123 / 41 = 3
y = [(a * f) - (c * e)] / dn
= (5 * -1) -(2 * 18) / 41 =
-41 / 41 = -1
Source:
1728.com/cramer.htm
3 boxes of 12″ =36 = 2 boxes of 18″
so shortest height at which the 2 stack will be the same height =36 inches
7.5 would be my best guess