AtCoder Beginner Contest 144 - 81

Having learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together.
Given an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print Yes; if it cannot, print No.

-----Constraints-----
 - 1 \leq N \leq 100
 - N is an integer.

-----Input-----
Input is given from Standard Input in the following format:
N

-----Output-----
If N can be represented as the product of two integers between 1 and 9 (inclusive), print Yes; if it cannot, print No.

-----Sample Input-----
10

-----Sample Output-----
Yes

10 can be represented as, for example, 2 \times 5.

Source: atcoder | Difficulty: EASY


Solutions:
n = int(input())
flag = 0
for i in range(1, 10):
	for j in range(1, 10):
		if j * i == n:
			flag = 1
if flag == 1:
	print('Yes')
else:
	print('No')


N = int(input())
for i in range(1, 10):
	for j in range(1, 10):
		if i * j == N:
			print('Yes')
			return
print('No')


N = int(input())
for i in range(9):
	for j in range(9):
		if (i + 1) * (j + 1) == N:
			print('Yes')
			exit()
print('No')


n = int(input())
ans = 'No'
for d in range(1, 10):
	if n % d == 0 and 1 <= n / d <= 9:
		ans = 'Yes'
print(ans)


n = int(input())
for i in range(1, 10):
	if n % i == 0 and 0 < n // i < 10:
		print('Yes')
		exit()
print('No')


N = int(input())
for i in range(1, 10):
	if 1 <= N / i <= 9 and N % i == 0:
		print('Yes')
		exit()
print('No')


n = int(input())
for i in range(1, 10):
	if n / i == n // i and n // i < 10:
		print('Yes')
		break
else:
	print('No')


n = int(input())
count = 0
for a in range(1, 10):
	for b in range(1, 10):
		if a * b == n:
			count += 1
if count >= 1:
	print('Yes')
else:
	print('No')


n = int(input())
d = set([i * j for i in range(1, 10) for j in range(1, 10)])
print('Yes' if n in d else 'No')


x = int(input())
t = 0
for i in range(1, 10):
	if x % i == 0 and x // i < 10:
		t = 1
if t == 1:
	print('Yes')
else:
	print('No')


n = int(input())
print('Yes' if any([n == x * y for x in range(1, 10) for y in range(1, 10)]) else 'No')


ans_list = [a * b for a in range(1, 10) for b in range(1, 10)]
print('Yes' if int(input()) in ans_list else 'No')


n = int(input())
product_list = list()
for i in range(1, 10):
	for j in range(1, 10):
		product_list.append(i * j)
if n in product_list:
	print('Yes')
else:
	print('No')


n = int(input())
ans = 'No'
for x in range(1, 10):
	if n / x in [1, 2, 3, 4, 5, 6, 7, 8, 9]:
		ans = 'Yes'
print(ans)


n = int(input())
for a in range(1, 10):
	if n % a == 0 and n / a <= 9:
		print('Yes')
		quit()
print('No')


N = int(input())
l = []
for i in range(1, 10):
	for h in range(1, 10):
		l.append(i * h)
print('Yes' if N in l else 'No')


N = int(input())
for a in range(1, 10):
	if N % a == 0 and N // a < 10:
		print('Yes')
		exit(0)
print('No')


s = {i * j for i in range(1, 10) for j in range(1, 10)}
print('Yes' if int(input()) in s else 'No')


A = []
for i in range(10):
	for j in range(10):
		A.append(i * j)
print('Yes' if int(input()) in A else 'No')


n = int(input())
flag = False
for i in range(1, 10):
	for j in range(1, 10):
		if i * j == n:
			flag = True
if flag == True:
	print('Yes')
else:
	print('No')


num = int(input())
range_num = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for _ in range_num:
	if num / _ in range_num:
		print('Yes')
		break
else:
	print('No')


print(' YNeos'[int(input()) in [a // 10 * (a % 10) for a in range(100)]::2])


n = int(input())
chk = False
for i in range(1, 10):
	if n % i == 0 and n // i <= 9:
		chk = True
print('Yes' if chk else 'No')


n = float(input())
print('Yes' if any([n / i in range(1, 10) and (n / i).is_integer() for i in range(1, 10)]) else 'No')


a = int(input())
f = False
for i in range(1, 10):
	if a % i == 0 and a / i < 10:
		f = True
		break
if f:
	print('Yes')
else:
	print('No')


N = int(input())
num = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for n in num:
	if N / n in num:
		print('Yes')
		exit()
print('No')


n = int(input())
k = [i * j for i in range(1, 10) for j in range(1, 10)]
if n in k:
	print('Yes')
else:
	print('No')


n = int(input())
a = 'No'
for i in range(10):
	for j in range(10):
		if i * j == n:
			a = 'Yes'
print(a)


n = int(input())
s = set([x * y for x in range(1, 10) for y in range(1, 10)])
print('Yes' if n in s else 'No')


n = int(input())
x = 'No'
for i in range(1, 10):
	if n % i == 0:
		if n // i < 10:
			x = 'Yes'
			break
print(x)


N = int(input())
for i in range(9):
	if N % (i + 1) == 0 and N / (i + 1) <= 9:
		print('Yes')
		break
else:
	print('No')


N = int(input())
Flag = False
for a in range(1, 9 + 1):
	for b in range(1, 9 + 1):
		if a * b == N:
			Flag = True
if Flag:
	print('Yes')
else:
	print('No')


n = int(input())
ans = 'No'
for i in range(1, 10):
	if n % i == 0:
		if n // i < 10:
			ans = 'Yes'
print(ans)


a = int(input())
for i in range(9):
	if a % (i + 1) == 0 and a / (i + 1) <= 9:
		print('Yes')
		exit()
print('No')


N = int(input())
L = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in range(1, 10):
	if N / i in L:
		print('Yes')
		exit()
print('No')


N = int(input())
flag = 0
for i in range(1, 10):
	for j in range(1, 10):
		if N == i * j:
			print('Yes')
			flag = 1
			break
	if flag == 1:
		break
if flag == 0:
	print('No')


N = int(input())
l = [i * j for i in range(1, 10) for j in range(1, 10)]
print('Yes' if N in l else 'No')


N = int(input())
c = 'No'
for n in range(1, 10):
	if N % n == 0 and 1 <= N // n <= 9:
		c = 'Yes'
		break
print(c)


n = int(input())
s = 0
if n > 81:
	print('No')
	return
for i in range(1, 10):
	if n % i == 0 and n // i < 10:
		s = 'Yes'
	else:
		s = 'No'
	if s == 'Yes':
		print(s)
		return
print(s)


n = int(input())

def binary_search(l, target):
	left = 0
	right = len(l)
	while left < right:
		mid = (left + right) // 2
		if target == l[mid]:
			return True
		elif target < l[mid]:
			right = mid
		else:
			left = mid + 1
	return False
seki = [i * j for i in range(1, 10) for j in range(1, 10)]
seki.sort()
if binary_search(seki, n):
	print('Yes')
else:
	print('No')


n = int(input())
ans = -1
for i in range(1, 10):
	for j in range(1, 10):
		if n == i * j:
			ans = 1
			break
if ans == 1:
	print('Yes')
else:
	print('No')


x = set([i * j for i in range(1, 10) for j in range(1, 10)])
if int(input()) in x:
	print('Yes')
else:
	print('No')


import sys
n = int(input())
for a in range(1, 10):
	if n % a == 0 and n // a <= 9:
		print('Yes')
		return
print('No')


N = int(input())
for i in range(1, 10):
	for x in range(1, 10):
		if i * x == N:
			print('Yes')
			return
else:
	print('No')


n = int(input())
cnt = 0
for i in range(1, 10):
	for j in range(1, 10):
		if i * j == n:
			print('Yes')
			return
else:
	print('No')


lst = [x * y for x in range(1, 10) for y in range(1, 10)]
if int(input()) in lst:
	print('Yes')
else:
	print('No')


print(' YNeos'[int(input()) in [a // 9 * (a % 10) for a in range(90)]::2])


N = int(input())
flag = 0
for i in range(1, 10):
	if N // i < 10 and N % i == 0:
		flag = 1
print(['No', 'Yes'][flag])


N = int(input())
k = set([i * j for i in range(10) for j in range(10)])
print('Yes' if N in k else 'No')


n = int(input())
ans = False
for i in range(1, 10):
	for j in range(1, 10):
		if i * j == n:
			ans = True
if ans == True:
	print('Yes')
elif ans == False:
	print('No')


N = int(input())
result = 'No'
for i in range(10):
	for j in range(10):
		if N == i * j:
			result = 'Yes'
			break
print(result)


N = int(input())
L = [x * y for x in range(1, 10) for y in range(1, 10)]
if L.count(N) != 0:
	print('Yes')
else:
	print('No')


import sys
n = int(input())
for i in range(10):
	for j in range(10):
		if i * j == n:
			print('Yes')
			return
print('No')


n = int(input())
flag = 0
for i in range(1, 10):
	if n % i == 0 and n / i < 10:
		flag = 1
print('YNeos'[flag != 1::2])


n = int(input())
y = 0
for i in range(1, 10):
	for j in range(1, 10):
		if i * j == n:
			y += 1
		else:
			pass
if y >= 1:
	print('Yes')
else:
	print('No')


N = int(input())
calculation = []
for i in range(1, 10):
	for j in range(1, 10):
		ans = i * j
		calculation.append(ans)
if N in calculation:
	print('Yes')
else:
	print('No')


n = int(input())
frag = 'No'
for i in range(9):
	if n / (i + 1) % 1 == 0 and n / (i + 1) <= 9:
		frag = 'Yes'
print(frag)


print(['No', 'Yes'][int(input()) in [j * i for i in range(1, 10) for j in range(1, 10)]])


def atc_144b(input_value: int) -> str:
	for i in range(1, 9 + 1):
		if input_value % i == 0 and input_value / i <= 9:
			return 'Yes'
	return 'No'
input_value = int(input())
print(atc_144b(input_value))


r = range(10)
print(' YNeos'[input() in [str(a * b) for a in r for b in r]::2])


N = int(input())

def can():
	judge = 'No'
	for i in range(1, 10):
		if int(N / i) < 10 and N % i == 0:
			judge = 'Yes'
			break
	return judge
print(can())


n = int(input())
li = []
for i in range(1, 10):
	for j in range(1, 10):
		li.append(i * j)
if n in li:
	print('Yes')
else:
	print('No')


N = int(input())
print('YNeos'[not [i for i in range(1, 10) if N % i == 0 and N // i < 10]::2])


def resolve():
	n = int(input())
	ans = 'No'
	for i in range(1, 10):
		for j in range(1, 10):
			if i * j == n:
				ans = 'Yes'
	print(ans)
resolve()


n = int(input())
print('No' if n % 10 == 0 and n > 10 or n % 11 == 0 or n == 96 else 'Yes')


N = int(input())
for i in range(1, 9 + 1):
	if N % i == 0 and N // i <= 9:
		print('Yes')
		return
print('No')


N = int(input())
answer = 'No'
for i in range(1, 10):
	if N % i == 0:
		A = N // i
		if A < 10:
			answer = 'Yes'
print(answer)


N = int(input())
a = 'No'
for i in range(1, 10):
	if N % i == 0 and N / i <= 9:
		a = 'Yes'
		break
print(a)


n = int(input())
f = 'No'
for i in range(1, 10):
	for j in range(1, 10):
		if i * j == n:
			f = 'Yes'
print(f)


import sys
n = int(input())
for a in range(1, 10):
	for b in range(1, 10):
		if a * b == n:
			print('Yes')
			return
print('No')


N = int(input())
flg = False
for i in range(1, 10):
	if N % i == 0 and N // i < 10:
		flg = True
		break
if flg:
	print('Yes')
else:
	print('No')


n = int(input())
print('Yes' if sum([1 for i in range(1, 10) if n % i == 0 and 0 < n // i < 10]) > 0 else 'No')


from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(500000)
INF = float('inf')
(YES, Yes, yes, NO, No, no) = ('YES', 'Yes', 'yes', 'NO', 'No', 'no')
(dy4, dx4) = ([0, 1, 0, -1], [1, 0, -1, 0])
(dy8, dx8) = ([0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1])

def inside(y, x, H, W):
	return 0 <= y < H and 0 <= x < W

def ceil(a, b):
	return (a + b - 1) // b

def sum_of_arithmetic_progression(s, d, n):
	return n * (2 * s + (n - 1) * d) // 2

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	g = gcd(a, b)
	return a / g * b

def solve():
	N = int(input())
	for i in range(1, 10):
		for j in range(1, 10):
			if i * j == N:
				print('Yes')
				return
	print('No')

def main():
	solve()

def __starting_point():
	main()
__starting_point()


r = range(10)
print(['No', 'Yes'][int(input()) in {i * j for i in r for j in r}])


n = int(input())
print('YNeos'[all((n // ~i < -9 or n % ~i < 0 for i in range(9)))::2])


A = set()
for i in range(1, 10):
	for j in range(1, 10):
		A.add(i * j)
print(['No', 'Yes'][int(input()) in A])


N = int(input())
msg = 'No'
for i in range(1, 10):
	if N / i < 10 and N % i == 0:
		msg = 'Yes'
		break
print(msg)


def __starting_point():
	N = int(input())
	ans = 'No'
	for i in range(1, 10):
		for j in range(1, 10):
			if i * j == N:
				ans = 'Yes'
	print(ans)
__starting_point()


print('YNeos'[int(input()) not in {i * j for j in range(1, 10) for i in range(1, 10)}::2])


N = int(input())
productos = []

def mult(N):
	for i in range(1, 10):
		for n in range(1, 10):
			calc = n * i
			productos.append(calc)
	if N in productos:
		print('Yes')
	else:
		print('No')
mult(N)


def N(n):
	for i in range(1, 10):
		for j in range(1, 10):
			ans = i * j
			if ans == n:
				print('Yes')
				return 0
	print('No')
n = int(input())
N(n)


a = int(input())
for i in range(9):
	if a % (9 - i) == 0 and a / (9 - i) < 10:
		print('Yes')
		break
else:
	print('No')


ls = []
for i in range(9):
	for j in range(9):
		ls.append(int((i + 1) * (j + 1)))
N = int(input())
if N in ls:
	print('Yes')
else:
	print('No')


r = range(10)
print(' YNeos'[int(input()) in [a * b for a in r for b in r]::2])


N = int(input())
flag = False
for i in range(10):
	if flag == True:
		continue
	if i != 0:
		one = N / i
		if one.is_integer() == True and one < 10:
			flag = True
if flag == True:
	print('Yes')
else:
	print('No')


n = int(input().strip())
print('Yes' if any((i * j == n for i in range(1, 10) for j in range(1, 10))) else 'No')


N = int(input())
nums = []
mul = []
for i in range(1, 9 + 1):
	if N % i == 0:
		nums.append(i)
	else:
		pass
for i in nums:
	for j in nums:
		mul.append(i * j)
if N in mul:
	print('Yes')
else:
	print('No')


N = int(input())
K = [i * j for i in range(10) for j in range(10)]
print('Yes' if N in K else 'No')


q = set([a * b for a in range(1, 10) for b in range(1, 10)])
if int(input()) in q:
	print('Yes')
else:
	print('No')


import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
mod = 10 ** 9 + 7
INF = 10 ** 18
eps = 10 ** (-7)
kuku = range(1, 10)
n = int(input())
d = False
for i in kuku:
	if n % i == 0 and n // i < 10:
		d = True
if d:
	print('Yes')
else:
	print('No')


n = int(input())
a = [(i + 1) * (j + 1) for i in range(9) for j in range(9)]
if n in a:
	print('Yes')
else:
	print('No')


print(' YNeos'[input() in [str(a // 10 * (a % 10)) for a in range(100)]::2])


n = int(input())
z = 'No'
for i in range(1, 10):
	if n % i == 0 and n / i <= 9:
		z = 'Yes'
print(z)


num = int(input())
print('Yes' if any((num // i < 10 and (not num % i) for i in range(1, 10))) else 'No')


N = int(input())
ans = False
for i in range(1, 10):
	for j in range(1, 10):
		if N == i * j:
			ans = True
if ans == True:
	print('Yes')
else:
	print('No')


X = list(range(1, 10))
Y = {i * j for i in X for j in X}
if int(input()) in Y:
	print('Yes')
else:
	print('No')


def abc144b(n: int) -> str:
	for i in range(1, 9 + 1):
		if n % i == 0 and 0 < n // i < 10:
			return 'Yes'
	return 'No'
n = int(input())
print(abc144b(n))


n = int(input())
for i in reversed(range(1, 10)):
	if n % i == 0 and n // i < 10:
		print('Yes')
		quit()
print('No')


n = int(input())
l = [i * j for i in range(1, 10) for j in range(1, 10)]
ans = 'No'
if n in l:
	ans = 'Yes'
print(ans)


print('Yes' if int(input()) in [i * m for i in range(1, 10) for m in range(1, 10)] else 'No')


n = int(input())
for i in range(1, 10):
	if n % i == 0:
		a = n // i
if a <= 9:
	print('Yes')
else:
	print('No')


N = int(input())
print('Yes' if any((N % d == 0 and N // d <= 9 for d in range(1, 10))) else 'No')


N = int(input())
for n in range(1, 10):
	if N % n == 0 and N // n < 10:
		print('Yes')
		break
else:
	print('No')


import sys
N = int(input())
for i in range(1, 10):
	if N % i == 0:
		if 1 <= N / i <= 9:
			print('Yes')
			return
		else:
			continue
print('No')


n = int(input())
table = [1, 2, 3, 4, 5, 6, 7, 8, 9]
flag = False
for a in range(1, 10):
	b = n / a
	if b in table:
		flag = True
		break
print('Yes' if flag else 'No')


N = int(input())
ans = 'No'
for a in range(10):
	for b in range(10):
		if N == a * b:
			ans = 'Yes'
print(ans)


N = int(input())
result = []
for i in range(1, 9 + 1):
	if N % i == 0 and N // i < 10:
		result.append(i)
import math
if len(result) == 0:
	print('No')
else:
	print('Yes')


N = int(input())
for x in range(1, 10):
	for y in range(1, 10):
		if x * y == N:
			print('Yes')
			return
print('No')


l = []
for i in range(1, 10):
	for x in range(1, 10):
		l.append(x * i)
n = int(input())
print('Yes' if n in l else 'No')


n = int(input())
count = 0
for i in range(1, 10):
	for j in range(1, 10):
		if i * j == n:
			print('Yes')
			count = 1
			break
	if count == 1:
		break
if count == 0:
	print('No')


a = int(input())
b = [i * j for i in range(1, 10) for j in range(1, 10)]
print('Yes' if a in b else 'No')


n = int(input())
print('Yes' if any((a * b == n for a in range(10) for b in range(10))) else 'No')


n = int(input())
ans = False
for i in range(1, 10):
	if n % i == 0 and n // i < 10 and (n <= 81):
		ans = True
		break
print('Yes' if ans == True else 'No')


N = int(input())
i = 1
A = 'No'
while i <= 9:
	if N // i * i == N and N // i <= 9:
		A = 'Yes'
		break
	i += 1
print(A)


n = int(input())
flag = 0
for i in range(1, 10):
	if n % i == 0:
		tar = n // i
		if tar > 0 and tar < 10:
			flag = 1
if flag == 0:
	print('No')
else:
	print('Yes')


n = int(input())
b = 0
for a in range(9):
	if n / (a + 1) < 10 and n % (a + 1) == 0:
		b = 1
if b == 1:
	print('Yes')
else:
	print('No')


N = int(input())
if N > 81:
	print('No')
else:
	state = 'No'
	for i in range(1, 10):
		for j in range(1, 10):
			if i * j == N:
				state = 'Yes'
				break
			if i * j > N:
				break
	print(state)


print(['No', 'Yes'][input() in {str(x * y) for x in range(1, 10) for y in range(1, 10)}])


def resolve():
	n = int(input())
	for i in range(1, 10):
		a = n // i
		if n % i == 0 and a < 10:
			print('Yes')
			return
	print('No')

def __starting_point():
	resolve()
__starting_point()


n = int(input())
l = list((v * h for h in range(1, 10) for v in range(1, 10)))
if n in l:
	print('Yes')
else:
	print('No')


i_n = int(input())
msg = 'No'
for i in range(1, 10):
	if i_n % i == 0 and i_n / i < 10:
		msg = 'Yes'
print(msg)


N = int(input())
S = []
for i in range(1, 10):
	for j in range(1, 10):
		S.append(i * j)
if N in S:
	print('Yes')
else:
	print('No')


kuku = []
for i in range(1, 10):
	for j in range(1, 10):
		if i * j not in kuku:
			kuku.append(i * j)
n = int(input())
if n in kuku:
	print('Yes')
else:
	print('No')


a = list(set([i * j for i in range(1, 10) for j in range(1, 10)]))
n = int(input())
print('Yes' if n in a else 'No')


t = set()
for i in range(1, 10):
	for j in range(1, 10):
		t.add(i * j)
print('Yes' if int(input()) in t else 'No')


x = int(input())
for i in range(1, 10):
	if x % i == 0:
		if x / i < 10:
			print('Yes')
			exit()
print('No')