-
Notifications
You must be signed in to change notification settings - Fork 0
/
donation drive
29 lines (25 loc) · 919 Bytes
/
donation drive
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
Problem
A blood drive aims to collect N number of blood donations.
The drive has collected X donations so far. Find the remaining number of donations needed to reach the target.
Input Format
The first line of input will contain a single integer T, denoting the number of test cases.
Each test case contains two space-separated integers N and X — the number of required donations and the number of collected donations, respectively.
/* 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
}
}