Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write in Java for me. Your computer lab often runs out of chairs to sit in during programming practices. In order to overcome this
Please write in Java for me.
Your computer lab often runs out of chairs to sit in during programming practices. In order to overcome this hardship, the team borrows chairs from other adjacent rooms. Given the number of people who are coming to practice and the number of chairs in the room, how many more chairs must the team take from other rooms? Sometimes there are enough chairs to begin with. In this case, we need not take any more chairs to the room. Input The input will begin with a single line containing T, the number of test cases to follow. On each of the next T lines there will be two integers, N ( 1SN s 10) and M single space. N is the number of people coming to practice that day and M is the number of chairs already in the room that day (O s M), separated by a Output The output will consist of T lines, each containing a single number the number of additional chairs needed for that day. Sample Input Sample Output 2 10 9 15 8 7Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started