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 , no discount.
- if , discount is rupees.
- if , discount is rupees.
- if , discount is 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
Sample 1:
Input
Output
4 15 70 250 1000
15 70 225 975
Explanation:
Test case : Since , there is no discount.
Test case : Here, . Since , discount is of rupees. Therefore, Chef needs to pay
Code Examples
AdvertisementsDemonstration
CodeChef solution SALESEASON - Sale Season Codechef solution in C,C++