COCI 2009/2010, Contest #5

Task SOK

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 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 ≤ ABC ≤ 500), the amount of orange, apple and pineapple juice they bought, in liters.

The second line contains three integers, I, J, K, (1 ≤ IJK ≤ 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, leftover amounts of each juice, in liters.

Note: solutions with relative error 10-4 or smaller will be accepted.

Sample Tests

Input

10 10 10
3 3 3

Output

0 0 0

Input

9 9 9
3 2 1

Output

0 3 6

Input

10 15 18
3 4 1

Output

0 1.666667 14.666667

All Submissions
Best Solutions


Point Value: 5
Time Limit: 1.00s
Memory Limit: 32M
Added: Jul 10, 2013

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

For people who are having trouble getting AC - printing out too many digits of precision can actually result in WA. Printing out 6 can lead to AC. (This is presumably because there isn't an absolute error tolerance present.)

This was due to the epsilon grader not being properly linked for this specific problem. It's fixed now and everything has been rejudged.