\[x\ км - горизонтальный\ путь;\]
\[y\ км - путь\ в\ гору\ (с\ горы).\]
\[\left\{ \begin{matrix} \frac{x}{10} + \frac{y}{6} = 4\ \ \ \ \ (1) \\ \frac{x}{10} + \frac{y}{12} = 3\ \ \ (2) \\ \end{matrix} \right.\ \]
\[(1) - (2):\ \ \frac{y}{12} = 1 \Longrightarrow y = 12.\]
\[\left\{ \begin{matrix} y = 12\ \ \ \ \ \ \ \ \ \ \\ \frac{x}{10} + \frac{12}{12} = 3 \\ \end{matrix} \right.\ \text{\ \ \ \ \ \ \ }\]
\[\left\{ \begin{matrix} y = 12\ \ \ \ \ \ \ \ \ \\ \frac{x}{10} + 1 = 3 \\ \end{matrix} \right.\ \text{\ \ \ \ \ \ \ }\]
\[\left\{ \begin{matrix} y = 12 \\ \frac{x}{10} = 2 \\ \end{matrix} \right.\ \text{\ \ \ \ \ \ \ \ \ \ }\]
\[\left\{ \begin{matrix} y = 12 \\ x = 20 \\ \end{matrix} \right.\ \]
\[12 + 20 = 32\ км.\]
\[Ответ:32\ км.\]