ONEFULPAIRS - Editorial

PROBLEM LINK:

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

Tester & Editorialist: iceknight1093

DIFFICULTY:

374

PREREQUISITES:

None

PROBLEM:

Given a and b, does the equation

a+b+(a\cdot b) = 111

hold?

EXPLANATION:

Simply do what the statement asks for: use an if condition to check whether a+b+(a\cdot b) = 111 and print Yes or No appropriately.

TIME COMPLEXITY

\mathcal{O}(1) per test case.

CODE:

Editorialist's code (Python)
a, b = map(int, input().split())
print('Yes' if a+b+a*b == 111 else 'No')