#C3603. Calculate Total Price with Discounts

    ID: 47049 Type: Default 1000ms 256MiB

Calculate Total Price with Discounts

Calculate Total Price with Discounts

You are given the price of a single item and the quantity purchased. Discounts are applied based on the quantity purchased following these rules:

  • If quantity \(\geq 100\), the discount is 20%.
  • If 50 \(\leq quantity \leq 99\), the discount is 10%.
  • If 20 \(\leq quantity \leq 49\), the discount is 5%.
  • Otherwise, no discount is applied.

Calculate the total price after applying the discount and round the result to two decimal places.

inputFormat

The input consists of a single line containing two values separated by space: a float number representing the price per item and an integer representing the quantity purchased.

outputFormat

Output a single line containing the final price after discount, rounded to two decimal places.## sample

10.00 10
100.00