But you can't handle it...
A friend of yours invented an amazing cocktail consisting of ingredients. However, they drank so much that they forgot the ratio of the ingredients in their recipe...
For pairs of ingredients, they remember the ratio at which each pair should be added to the cocktail. Fortunately, this information is enough for your friend to recover the entire recipe.
Problem
Write a program to help your friend recover the recipe for the cocktail.
Input Files
The first line of input contains the number . Each of the next lines contains four numbers , , , and , separated by spaces. This line means that the ratio of ingredient to ingredient in the cocktail should be .
The ingredients are numbered from to .
Output Files
The output will consist of lines.
The first line of output will contain the percentage ratio (rounded to two decimal places) of ingredient in the cocktail.
Similarly, the second line of output will contain the percentage ratio of ingredient , and so on.
Example of INput - Output Files:
STDIN (cocktails.in)
3
0 1 9 4
2 1 1 2
STDOUT (cocktails.out)
3
60.00
26.67
13.33
1
Constraints
- .
- The numbers and in the given ratios will be from to .
- Maximum execution time: 1 sec.
- Maximum available memory: 64 MB.
Comments