#C2206. Phone Call Billing Cost Calculator

    ID: 45497 Type: Default 1000ms 256MiB

Phone Call Billing Cost Calculator

Phone Call Billing Cost Calculator

Given the duration of a phone call in minutes, calculate its total cost based on the following billing scheme:

  • For the first 5 minutes, the rate is $0.10 per minute.
  • For the next 10 minutes (i.e. minutes 6 to 15), the rate is $0.08 per minute.
  • For every minute beyond 15, the rate is $0.05 per minute.

The total cost is computed as follows: \(\text{cost} = 0.10\cdot \min(\text{duration},5) + 0.08\cdot \min(\max(\text{duration}-5,0),10) + 0.05\cdot \max(\text{duration}-15,0)\). Round the final answer to two decimal places.

inputFormat

A single integer is given on standard input, representing the duration of the call in minutes.

outputFormat

Output the total cost of the phone call, rounded to two decimal places. The result should be printed on standard output.## sample

0
0.00