13.363. A certain alloy contains metals $A$ and $B$ in the ratio $m:n$, another - the same metals in the ratio $p:q$. What quantities of the first and second alloys need to be taken to obtain 1 kg of a third alloy with equal content of metals $A$ and $B$?
Solution.

Let $x$ be the mass of the first alloy, in which $\frac{m}{n+m} x$ is metal $A$ and $\frac{n}{n+m} x$ is metal $B$.

$\frac{p}{p+q}(1-x)$ is metal $A$ and $\frac{q}{p+q}(1-x)$ is metal $B$.

According to the condition, $\frac{n}{n+m} x+\frac{p}{p+q}(1-x)=\frac{n}{n+m} x+\frac{q}{p+q}(1-x)$, from which $x=\frac{1}{2}+\frac{m p-n q}{2(n p-m q)}$.

Answer: $\frac{1}{2}+\frac{m p-n q}{2(n p-m q)} ; \frac{1}{2}-\frac{m p-n q}{2(n p-m q)}$.