Paints
Time limit1sMemory limit128 MB
Compute the extra red, yellow, and blue paint to buy after splitting each mixed room amount evenly between its two base colors.
- Level
Easy2 of 10
- Topics
- Math
- Solved
- No attempts yet
Problem
A general cleanup has begun at a school. The principal decided to refresh the ground-floor rooms and have them painted in her favorite colors.
There are 6 different rooms on the ground floor, and the principal wants them painted as follows:
- Room 1: yellow
- Room 2: green
- Room 3: blue
- Room 4: purple
- Room 5: red
- Room 6: orange
The caretaker recalls that the storeroom holds some amount of red, yellow, and blue paint. These three colors are enough to paint every room, because the other colors can be produced by mixing two paints in equal amounts:
- green = yellow + blue (equal amounts)
- purple = blue + red (equal amounts)
- orange = yellow + red (equal amounts)
In other words, every mixed color uses its two base paints in an exact ratio. Determine how much more red, yellow, and blue paint the caretaker must buy to paint all the rooms.
Input
The first line contains three positive integers , , and separated by single spaces: the amount of red paint (), the amount of yellow paint (), and the amount of blue paint () that the caretaker has.
Each of the next 6 lines contains one positive integer (), the amount of paint needed to paint the -th room, given in order.
Output
Print how much more red, yellow, and blue paint must be bought to paint all the rooms, in that order, separated by single spaces on one line. If a value is not an integer, print it with one digit after the decimal point.