#C2565. Bakery Discount Calculator

    ID: 45895 Type: Default 1000ms 256MiB

Bakery Discount Calculator

Bakery Discount Calculator

A local bakery offers discounts on its baked goods based on the quantity purchased. The discount rules are as follows:

  • Bread: For every 3 loaves purchased, you only pay for 2. In formulas, if \(b\) denotes the number of breads, then the cost is computed as: \(\Big(\lfloor b/3 \rfloor \times 2 + (b \bmod 3)\Big) \times 3.00\).
  • Cake: For every 2 cakes, the second cake is offered at a 50% discount. If \(c\) denotes the number of cakes, the cost is: \(\lfloor c/2 \rfloor \times 10.5 + (c \bmod 2) \times 7.00\). (Since one cake costs $7.00, the pair costs \(7.00 + 3.50 = 10.50\)).
  • Cookie: For every 5 cookies purchased, you pay only for 3. That is, if \(k\) denotes the number of cookies, then the cost is: \(\Big(\lfloor k/5 \rfloor \times 3 + (k \bmod 5)\Big) \times 2.00\).

Given the quantities of bread, cake, and cookie purchased, your task is to calculate the total cost, rounding the final answer to two decimal places.

Note: All prices are in dollars.

inputFormat

The input consists of a single line containing three non-negative integers separated by spaces:

  • The first integer represents the quantity of bread.
  • The second integer represents the quantity of cake.
  • The third integer represents the quantity of cookie.

If a particular type is not purchased, its number will be 0.

outputFormat

Output the total cost of the purchase on a single line. The result should be a float rounded to two decimal places.

## sample
1 1 1
12.00