Let the total cost be \( C \), and assume the initial cost of the components is divided between the German mark and the USA dollar, which are 30% and 50% of the total cost, respectively.
- The cost of the German mark increases by 20%, so the new cost of the German component is \( 1.2 \times 0.3C = 0.36C \).
- The cost of the USA dollar decreases by 12%, so the new cost of the USA component is \( 0.88 \times 0.5C = 0.44C \).
The new total cost is:
\[
\text{New total cost} = 0.36C + 0.44C = 0.8C.
\]
The gain is the difference between the original cost and the new cost:
\[
\text{Gain} = C - 0.8C = 0.2C.
\]
Thus, the gain is 20%.