PROBLEM LINK:
Practice
Contest: Division 1
Contest: Division 2
Contest: Division 3
Contest: Division 4
Author: raysh07
Tester: sushil2006
Editorialist: iceknight1093
DIFFICULTY:
Cakewalk
PREREQUISITES:
None
PROBLEM:
Chef has N rupees. he bought A ice creams worth B rupees each. How much money does he have left?
EXPLANATION:
Buying A ice creams for B rupees costs a total of A\times B rupees.
So, the amount remaining with Chef is
N - (A \times B)
rupees.
TIME COMPLEXITY:
\mathcal{O}(1) per testcase.
CODE:
Editorialist's code (PyPy3)
n, a, b = map(int, input().split())
print(n - a*b)