Algorithm
problem Link : https://www.codechef.com/problems/TAXES
Problem
In Chefland, a tax of rupees is deducted if the total income is strictly greater than rupees .
Given that total income is rupees, find out how much money you get.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- The first and only line of each test case contains a single integer — your total income.
Output Format
For each test case, output on a new line, the amount of money you get.
Constraints
Sample 1:
4 5 105 101 100
5 95 91 100
Explanation:
Test case : Your total income is rupees which is less than rupees. Thus, no tax would be deducted and you get rupees.
Test case : Your total income is rupees which is greater than rupees. Thus, a tax of rupees would be deducted and you get rupees.
Test case : Your total income is rupees which is greater than rupees. Thus, a tax of rupees would be deducted and you get rupees.
Test case : Your total income is rupees which is equal to rupees. Thus, no tax would be deducted and you get rupees.
Code Examples
#1 Code Example with C Programming
Code -
C Programming
#include<stdio.h>
int main(void) {
int t,i;
scanf("%d",&t);
while(t--)
{
scanf("%d",&i);
if(i>100) printf("%d\n",i-10);
else printf("%d\n",i);
}
return 0;
}
Copy The Code &
Try With Live Editor
Input
5
105
101
100
Output
95
91
100
Demonstration
CodeChef solution TAXES - Tax in Chefland CodeChef solution in C,C++