In scalene $\triangle ABC$, $I$ is the incenter, $I_a$ is the $A$-excenter, $D$ is the midpoint of arc $BC$ of the circumcircle of $ABC$ not containing $A$, and $M$ is the midpoint of side $BC$. Extend ray $IM$ past $M$ to point $P$ such that $IM = MP$. Let $Q$ be the intersection of $DP$ and $MI_a$, and $R$ be the point on the line $MI_a$ such that $AR\parallel DP$. Given that $\frac{AI_a}{AI}=9$, the ratio $\frac{QM} {RI_a}$ can be expressed in the form $\frac{m}{n}$ for two relatively prime positive integers $m,n$. Compute $m+n$.

[i]Ray Li.[/i]

[hide="Clarifications"][list=1][*]"Arc $BC$ of the circumcircle" means "the arc with endpoints $B$ and $C$ not containing $A$".[/list][/hide]
1. **Define the angles and relationships:**
   Let \( \angle BAC = A \), \( \angle ABC = B \), and \( \angle ACB = C \). We know that \( D \) is the midpoint of the arc \( BC \) not containing \( A \), so \( D \) is equidistant from \( B \) and \( C \). This implies that \( \angle BDC = \angle BIC = 90^\circ + \frac{A}{2} \).

2. **Calculate angles involving \( I \) and \( D \):**
   Since \( I \) is the incenter, \( \angle BIC = 90^\circ + \frac{A}{2} \). Also, \( \angle BID = \angle CID = \frac{B}{2} + \frac{C}{2} = 90^\circ - \frac{A}{2} \).

3. **Establish the cyclic quadrilateral:**
   The quadrilateral \( CIBI_a \) is cyclic because \( \angle BIC = \angle BI_aC = 90^\circ + \frac{A}{2} \) and \( \angle BCI_a = 90^\circ - \frac{A}{2} \). This implies that \( \angle II_aC = \angle IBC = \frac{B}{2} \).

4. **Use the given ratio \( \frac{AI_a}{AI} = 9 \):**
   We know that \( AI_a \) is the A-exradius and \( AI \) is the inradius. Given \( \frac{AI_a}{AI} = 9 \), we can write:
   \[
   AI_a = 9 \cdot AI
   \]

5. **Relate \( DI_a \) and \( AI \):**
   Since \( DI_a = DI \) and \( DI \) is the distance from \( D \) to the incenter \( I \), we have:
   \[
   9 = \frac{AI_a}{AI} = \frac{2DI_a + AI}{AI} = \frac{2DI_a}{AI} + 1 \implies 2DI_a = 8AI \implies DI_a = 4AI
   \]

6. **Homothety and midpoint properties:**
   Since \( M \) is the midpoint of \( BC \) and \( IM = MP \), the point \( P \) is such that \( IM = MP \). This implies a homothety centered at \( I \) with a ratio of 2. Therefore, \( DM \parallel PI_a \) and \( 2DM = PI_a \).

7. **Similar triangles and ratios:**
   Since \( \triangle DQM \sim \triangle PQI_a \), we have:
   \[
   \frac{QM}{QI_a} = \frac{DM}{PI_a} = \frac{1}{2}
   \]
   Thus, \( 2QM = QI_a \).

8. **Parallel lines and final ratio:**
   Given \( DP \parallel AR \), we have:
   \[
   \frac{QI_a}{RI_a} = \frac{DI_a}{AI_a} = \frac{4AI}{9AI} = \frac{4}{9}
   \]
   Since \( 2QM = QI_a \), we get:
   \[
   \frac{2QM}{RI_a} = \frac{4}{9} \implies \frac{QM}{RI_a} = \frac{2}{9}
   \]

The final answer is \( \boxed{11} \).