SANDWSHOP - Editorial

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 sells sandwiches for A rupees.
The buns cost B rupees, while the vegetables cost C rupees.
What is the profit from selling one sandwich?

EXPLANATION:

The cost of making one sandwich is (B+C) rupees, for buying the buns and vegetables.
Since it’s sold for A rupees, the overall profit is

A - (B+C)

TIME COMPLEXITY:

\mathcal{O}(1) per testcase.

CODE:

Editorialist's code (PyPy3)
a, b, c = map(int, input().split())
print(a - b - c)