Algorithm


problem Link : https://www.codechef.com/problems/SALESEASON 

Problem

It's the sale season again and Chef bought items worth a total of  rupees. The sale season offer is as follows:

  • if �≤100, no discount.
  • if 100<�≤1000, discount is 25 rupees.
  • if 1000<�≤5000, discount is 100 rupees.
  • if �>5000, discount is 500 rupees.

Find the final amount Chef needs to pay for his shopping.

Input Format

  • The first line of input will contain a single integer , denoting the number of test cases.
  • Each test case consists of single line of input containing an integer .

Output Format

For each test case, output on a new line the final amount Chef needs to pay for his shopping.

Constraints

  • 1≤�≤100
  • 1≤�≤10000

Sample 1:

Input
 
Output
 
4
15
70
250
1000
15
70
225
975

Explanation:

Test case 1: Since �≤100, there is no discount.

Test case 3: Here, �=250. Since 100<250≤1000, discount is of 25 rupees. Therefore, Chef needs to pay 250−25=225

 <�≤

Code Examples

Advertisements

Demonstration


 CodeChef solution SALESEASON  - Sale Season Codechef solution  in C,C++

Previous
CodeChef solution CRICMATCH - Cricket Match Codechef solution in C,C++
Next
CodeChef solution CHEFGAMES - Chefland Games Codechef solution in C,C++