Problem list
Log in
#coci00133 · COCI 2009/2010 Contest 5

Sok

Bronze I 1.0 s 32 MB

Mirko and Slavko bought a few litters of orange, apple and pineapple juice. They are now whipping up a non alcoholic cocktail following a recipe they found on the Internet. Sadly, they figured out too late that not only you should use recipes when making cocktails, you should also use them when planning how much juice to buy. Write a program that will determine how much of each juice they will have leftover, after they make as much cocktail as possible, respecting the recipe.

Input

The first line contains three integers, $A$, $B$, $C$ ($1 \le A, B, C \le 500$), amount of orange, apple and pineapple juice they bought, in litres.

The second line contains three integers, $I$, $J$, $K$ ($1 \le I, J, K \le 50$), the ratio of orange, apple and pineapple juice in the cocktail.

Output

The first and only line of output should contain three decimal numbers, the leftover amounts of each juice, in litres.

Note: solutions with relative error $10^{-4}$ or smaller will be accepted.

Example 1

Input
10 10 10
3 3 3
Output
0 0 0

Example 2

Input
9 9 9
3 2 1
Output
0 3 6

Example 3

Input
10 15 18
3 4 1
Output
0 1.666667 14.666667
Source
COCI 2009/2010 Contest 5
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code