PROBLEM LINK:
Practice
Contest: Division 1
Contest: Division 2
Contest: Division 3
Contest: Division 4
Author: notsoloud
Tester: satyam_343
Editorialist: iceknight1093
DIFFICULTY:
272
PREREQUISITES:
None
PROBLEM:
A blood drive aims to collect N donations, of which X have been collected so far.
How many more are needed to reach their target?
EXPLANATION:
X out of N donations are done, which leaves N-X remaining.
So, the answer is N-X.
TIME COMPLEXITY
\mathcal{O}(1) per testcase.
CODE:
Editorialist's code (Python)
testcases = int(input())
for t in range(testcases):
n, x = map(int, input().split())
print(n - x)