-
Notifications
You must be signed in to change notification settings - Fork 0
/
saving taxes
32 lines (28 loc) · 1.09 KB
/
saving taxes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Problem
In Chefland, everyone who earns strictly more than Y rupees per year, has to pay a tax to Chef.
Chef has allowed a special scheme where you can invest any amount of money and claim exemption for it.
You have earned (X>Y) rupees this year. Find the minimum amount of money you have to invest so that you don't have to pay taxes this year.
Input Format
The first line of input will contain a single integer T, denoting the number of test cases.
Each test case consists of a single line of input consisting of two space separated integers X and Y denoting the amount you earned
and the amount above which you will have to pay taxes.
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
for(int i=0;i<t;i++)
{
int a=sc.nextInt();
int b=sc.nextInt();
int c=a-b;
System.out.println(c);
}// your code goes here
}
}