PROBLEM LINK:
Practice
Contest: Division 1
Contest: Division 2
Contest: Division 3
Contest: Division 4
Author: am_aadvik
Tester: raysh07
Editorialist: iceknight1093
DIFFICULTY:
Cakewalk
PREREQUISITES:
None
PROBLEM:
Chef is selling N pizzas, each costing R rupees.
Exunites bought K of them.
How much can Chef earn by selling his remaining pizzas?
EXPLANATION:
Chef started with N pizzas, and K of them were bought.
So, Chef has (N-K) pizzas remaining.
Each pizza sells for R rupees.
So, the total amount Chef can earn by selling these (N-K) pizzas equals
(N-K) \times R
TIME COMPLEXITY:
\mathcal{O}(1) per testcase.
CODE:
Editorialist's code (PyPy3)
n, k, r = map(int, input().split())
print(r * (n-k))