Alloy Coin
Time limit1sMemory limit1024 MB
Given two metal densities and the mass percentage of the denser metal, the task is to compute the density of the resulting alloy coin.
- Level
Easy1 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
The first prize in the 1st AGCU Cup includes a silver coin.
Bi-haeng-ssi collects commemorative coins. After spending his savings on coins, he spent the whole day cleaning them, and decided to rank the coins by density, the mass of a substance divided by its volume.
Bi-haeng-ssi does not have a scale, so he must estimate the density of a coin using only the information he already has. He knows that the coin is an alloy of two metals, the density of each metal before mixing, and the mass ratio of the two metals in the alloy.
The volume of the mixture equals the sum of the volumes of the two substances before mixing, and the mass of the mixture equals the sum of their masses before mixing.
Tell Bi-haeng-ssi the density of the coin.
Input
The first line contains three integers , , and , separated by spaces, where .
and are the densities of the two metals in the coin and are different from each other. Their unit is .
is the percentage of the coin's mass made up by the metal with the higher density. Its unit is .
Output
Print the density of the coin on the first line, without the unit . An absolute or relative error up to is allowed.