Algorithm
problem Link : https://www.codechef.com/problems/IPLTRSH
Problem
DAIICT college students want to attend an IPL match.
A total of students from the college want to go while only tickets are available for the match.
Determine how many students won't be able to book tickets.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- Each test case consists of two space-separated integers and — the number of students wants to go and the total number of tickets available, respectively.
Output Format
For each test case, output on a new line the number of students who won't be able to book tickets.
Constraints
Sample 1:
4 5 3 5 7 4 1 8 8
2 0 3 0
Explanation:
Test case : There are students who want to go, and only tickets are available. Hence students won't be able to get tickets.
Test case : There are students who want to go, and tickets are available. So, every one of them will get the tickets.
Test case : There are students who want to go, and only ticket is available. Hence students won't be able to get tickets.
Test case : There are students who want to go, and tickets are available. So, every one of them will get the tickets.
Code Examples
AdvertisementsDemonstration
CodeChef solution IPLTRSH - IPL Ticket Rush Codechef solution in C,C++