GAMBLING - 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 rolls two standard 6-sided dice. The first one shows A.
What number should the second show for the total to equal 7?

EXPLANATION:

If the number on the second die is B, it should satisfy A+B = 7.
This gives us B = 7 - A after rearrangement, so the answer is simply

7-A

TIME COMPLEXITY:

\mathcal{O}(1) per testcase.

CODE:

Editorialist's code (PyPy3)
a = int(input())
print(7-a)