The formulae for two manganese compounds are $\text{MnO}_2$ and $\text{KMnO}_4$. For both of these compounds, potassium has an oxidation state of $+1$ and oxygen has an oxidation state of $-2$. What are the oxidation states of manganese in each compound?