-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOneful_Pair.py
More file actions
19 lines (16 loc) · 915 Bytes
/
Oneful_Pair.py
File metadata and controls
19 lines (16 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Oneful Pairs Chef defines a pair of positive integers ( a , b )
# (a,b) to be a Oneful Pair, if a + b + ( a ⋅ b ) = 111 a+b+(a⋅b)=111
# For example, ( 1 , 55 ) (1,55) is a Oneful Pair,
# since 1+55+(1⋅55)=56+55=111.
# But ( 1 , 56 ) (1,56) is not a Oneful Pair, since 1 + 56 + ( 1 ⋅ 56 ) = 57 + 56 = 113 ≠ 111
# 1+56+(1⋅56)=57+56=113=111.
# Given two positive integers a and b, output Yes if they are a Oneful Pair.
# And No otherwise. Input Format The only line of input contains two space-separated integers a and b.
# Output Format Output Yes, if ( a , b ) form a Oneful Pair.
# Output No if they do not. You may print each character of Yes and No in uppercase or lowercase
# (for example, yes, yEs, Yes will be considered identical). make lines in format
a,b = map(int,input().split())
if((a+b+(a*b))==111):
print("Yes")
else:
print("No")