This page is still under construction.

Parts of this page are still being built. What you see may change.

Paints

Time limit1sMemory limit128 MB

Summary
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 1:11:1 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 cc, zz, and nn separated by single spaces: the amount of red paint cc (0<c<1090 < c < 10^9), the amount of yellow paint zz (0<z≤1090 < z \le 10^9), and the amount of blue paint nn (0<n≤1090 < n \le 10^9) that the caretaker has.

Each of the next 6 lines contains one positive integer pip_i (0<pi≤10000 < p_i \le 1000), the amount of paint needed to paint the ii-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.

Examples1

  1. Example 1

    Input
    20 10 8
    10
    4
    5
    3
    3
    8
    
    Expected output
    0 6 0.5