FOODCOST - Editorial

PROBLEM LINK:

Practice
Contest: Division 1
Contest: Division 2
Contest: Division 3
Contest: Division 4

Author: raysh_07
Tester: apoorv_me
Editorialist: iceknight1093

DIFFICULTY:

TBD

PREREQUISITES:

None

PROBLEM:

You eat at the college mess everyday, except Sunday.
Eating at the mess costs Rs. X, eating at a restaurant costs Rs. Y.
What’s the total amount you spend in a week?

EXPLANATION:

There are 7 days in a week; of which you eat at the mess on 6 of them.
So, the total cost is 6\cdot X + Y.

TIME COMPLEXITY:

\mathcal{O}(1) per testcase.

CODE:

Editorialist's code (Python)
x, y = map(int, input().split())
print(6*x + y)