Discount Calculator

A store is running a promotion where they apply different discounts based on the total purchase amount:
  • Less than $50 ⇒ No discount
  • $50 to $100 ⇒ 10% discount
  • $101 to $200 ⇒ 20% discount
  • More than $200 ⇒ 30% discount
Write a program that calculates the final price after the discount is applied. The input consists of a single number representing the total purchase amount. The program should print the final price after applying the appropriate discount.
Input
Output
150
120
400
280
75
67.5
 

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue