The diagram below shows an $8$x$7$ rectangle with a 3-4-5 right triangle drawn in each corner. The lower two triangles have their sides of length 4 along the bottom edge of the rectangle, while the upper two
triangles have their sides of length 3 along the top edge of the rectangle. A circle is tangent to the hypotenuse of each triangle. The diameter of the circle is $\frac{m}{n}$ , where m and n are relatively prime positive integers. Find m + n.
For diagram go to http://www.purplecomet.org/welcome/practice, go to the 2015 middle school contest questions, and then go to #20
1. **Identify the problem and given information:**
   - We have an $8 \times 7$ rectangle with a 3-4-5 right triangle drawn in each corner.
   - The lower two triangles have their sides of length 4 along the bottom edge of the rectangle.
   - The upper two triangles have their sides of length 3 along the top edge of the rectangle.
   - A circle is tangent to the hypotenuse of each triangle.
   - We need to find the diameter of the circle in the form $\frac{m}{n}$, where $m$ and $n$ are relatively prime positive integers, and then find $m + n$.

2. **Define the radius of the circle:**
   - Let the radius of the circle be $x$.

3. **Analyze the geometry and slopes:**
   - Draw radii to the points of tangency.
   - The slopes of segments $\overline{BI}$ and $\overline{GI}$ are $\frac{4}{3}$ and $-\frac{3}{4}$ respectively, so $\overline{BI}$ is perpendicular to $\overline{GI}$.
   - Similarly, $\overline{EG} \perp \overline{CE}$.

4. **Identify segments of length $x$:**
   - We find that $IS = IP = ER = EQ = x$.
   - Also, $BP = GS = GR = CQ = 5 - x$.

5. **Use congruence to find areas:**
   - By LL congruence, $\triangle OPB \cong \triangle OQC \cong \triangle ORG \cong \triangle OSG$.

6. **Calculate the area of the pentagon $BCEGI$:**
   - The area of the pentagon equals $[ADFH] - 4[\triangle ABI] = 32$.
   - Also, $[OPIS] + [OQER] + 4[\triangle OSG] + [\triangle BCO]$.
   - The second quantity works out to be $x^2 + x^2 + \frac{4}{2}x(5 - x) + OT = 10x + OT$.

7. **Determine segment $OT$:**
   - Segment $\overline{GT}$ is drawn so that it passes through point $O$ and is parallel to $\overline{AH}$.
   - By the Pythagorean Theorem, $GO = \sqrt{x^2 + (5 - x)^2} = \sqrt{2x^2 - 10x + 25}$.
   - Therefore, $OT = 7 - \sqrt{2x^2 - 10x + 25}$.

8. **Set up the equation for the area:**
   - The equation derived from finding the area of pentagon $BCEGI$ is $10x + 7 - \sqrt{2x^2 - 10x + 25} = 32$.
   - Simplify to $10x - 25 = \sqrt{2x^2 - 10x + 25}$.

9. **Solve the equation:**
   - Square both sides: $(10x - 25)^2 = 2x^2 - 10x + 25$.
   - Expand and simplify: $100x^2 - 500x + 625 = 2x^2 - 10x + 25$.
   - Combine like terms: $98x^2 - 490x + 600 = 0$.
   - Simplify: $49x^2 - 245x + 300 = 0$.
   - Solve the quadratic equation using the quadratic formula: $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$.
   - Here, $a = 49$, $b = -245$, and $c = 300$.
   - $x = \frac{245 \pm \sqrt{245^2 - 4 \cdot 49 \cdot 300}}{2 \cdot 49}$.
   - $x = \frac{245 \pm \sqrt{60025 - 58800}}{98}$.
   - $x = \frac{245 \pm \sqrt{1225}}{98}$.
   - $x = \frac{245 \pm 35}{98}$.
   - $x = \frac{280}{98}$ or $x = \frac{210}{98}$.
   - Simplify: $x = \frac{20}{7}$ (since $x$ must be positive).

10. **Find the diameter of the circle:**
    - The diameter is $2x = 2 \cdot \frac{20}{7} = \frac{40}{7}$.

11. **Determine $m + n$:**
    - Here, $m = 40$ and $n = 7$.
    - Therefore, $m + n = 40 + 7 = 47$.

The final answer is $\boxed{47}$