12. Rhombus $P Q R S$ is inscribed in rectangle $A B C D$, such that $P, Q, R, S$ are interior points on $\overline{A B}, \overline{B C}, \overline{C D}, \overline{D A}$. Given that $P B=15, B Q=20, P R=30, Q S$ $=40$. If the reduced fraction $\frac{m}{n}$ is the perimeter of rectangle $A B C D$, find $m+n$.
12. As shown in the figure, let $x, y$ represent the lengths of $Q C, R C$ respectively. By symmetry, the lengths of $SA, PA$ are also $x, y$.
The diagonals of the rectangle intersect at the center H of the rectangle, and they are perpendicular to each other, thus forming eight right triangles. Six of these right triangles have side lengths of $15, 20, 25$, and the other two triangles ($\triangle A S P$, $\triangle C Q R$) have side lengths of $x, y, 25$.
The sum of the areas of these eight parts is 
$$
6 \times(150)+2\left(\frac{1}{2} x y\right)=S_{\triangle B C D}=(20+x)(15+y) \text {, }
$$

Thus, $3 x+4 y=120$.
Also, $\because x^{2}+y^{2}=625$,
$\therefore 5 x^{2}-144 x+880=0$.
That is, $(5 x-44)(x-20)=0$.
When $x=20$, it leads to $B C=40$, which contradicts $P R=30$. Therefore, $x=\frac{44}{5}, y=\frac{117}{5}$.
Thus, the perimeter of $A B C D$ is
$$
2(15+20+x+y)=\frac{672}{5} \text {. }
$$

Therefore, $m+n=677$.