Read problem statements in [Hindi], [Bengali], [Mandarin Chinese], [Russian], and [Vietnamese] as well.

You are given an integer $N$. Find the largest integer between $1$ and $10$ (inclusive) which divides $N$.

------  Input ------
The first and only line of the input contains a single integer $N$. 

------  Output ------
Print a single line containing one integer ― the largest divisor of $N$ between $1$ and $10$.

------  Constraints ------
$2 ≤ N ≤ 1,000$

------  Subtasks ------
Subtask #1 (100 points): original constraints

----- Sample Input 1 ------ 
91
----- Sample Output 1 ------ 
7
----- explanation 1 ------ 
The divisors of $91$ are $1, 7, 13, 91$, out of which only $1$ and $7$ are in the range $[1, 10]$. Therefore, the answer is $\max(1, 7) = 7$.

----- Sample Input 2 ------ 
24
----- Sample Output 2 ------ 
8
----- explanation 2 ------ 
The divisors of $24$ are $1, 2, 3, 4, 6, 8, 12, 24$, out of which $1, 2, 3, 4, 6, 8$ are in the range $[1, 10]$. Therefore, the answer is $\max(1, 2, 3, 4, 6, 8) = 8$.

Difficulty: EASY
Tags: Complete search
Skill types: Complete search

Starter code:

Solutions:
n = int(input())
l = []
for i in range(1, 11):
	if n % i == 0:
		l.append(i)
print(max(l))


p = int(input())
x = []
r = []
for i in range(1, p + 1):
	if p % i == 0:
		x.append(i)
for i in x:
	if i >= 1 and i <= 9:
		r.append(i)
print(max(r))


n = int(input())
max = 0
for i in range(1, 11):
	if n % i == 0 and max < i:
		max = i
print(max)


n = int(input())
for i in range(1, 11):
	if n % i == 0:
		m = i
print(m)


N = int(input())
j = 1
while j < 10:
	if N % j == 0:
		a = j
	j += 1
print(a)


num = int(input())
for i in range(10, 0, -1):
	if num % i == 0:
		print(i)
		break


n = int(input())
find = []
for i in range(1, 10):
	if n % i == 0:
		find.append(i)
print(max(find))


a = int(input())
b = 0
for j in range(1, 11):
	if a % j == 0:
		b = j
print(b)


n = int(input())
l = []
i = 1
while i < 10:
	if n % i == 0:
		l.append(i)
	i = i + 1
print(max(l))


n = int(input())
l = []
for i in range(1, n + 1):
	if n % i == 0 and i <= 10:
		l.append(i)
print(max(l))


n = int(input())
i = 1
while i < 10:
	if n % i == 0:
		c = i
	i += 1
print(c)


N = int(input())
e = 1
for i in range(10):
	if N % e == 0:
		ans = e
	e = e + 1
print(ans)


a = int(input())
ar = []
for i in range(1, 10):
	if a % i == 0:
		ar.append(i)
print(max(ar))


n = int(input())
i = 1
while i <= 10:
	if n % i == 0:
		k = i
	i += 1
print(k)


n = int(input())
r = []
for k in range(1, 11):
	if n % k == 0:
		r.append(k)
print(max(r))


N = int(input())
arr = []
for i in range(1, 11):
	if N % i == 0:
		arr.append(i)
print(max(arr))


n = int(input())
l1 = []
l3 = []
l2 = [i for i in range(1, 11)]
for i in range(1, n + 1):
	if n % i == 0:
		l1.append(i)
for val in l1:
	if val in l2:
		l3.append(val)
print(max(l3))


n = int(input())
l1 = []
l = [int(x) for x in range(1, 101) if n % x == 0]
for i in l:
	if i <= 10:
		l1.append(i)
print(max(l1))


d = int(input())
for i in range(1, 11):
	if d % i == 0:
		w = i
print(w)


x = int(input())
a = []
for i in range(10, 0, -1):
	if x % i == 0:
		print(i)
		break


n = int(input())
i = 1
a = 1
while i < 11:
	if n % i == 0:
		a = i
	i = i + 1
print(a)


def code():
	N = int(input())
	integers_that_divide = []
	for i in range(1, 11):
		if N % i == 0:
			integers_that_divide.append(i)
	print(max(integers_that_divide))
code()


a = int(input())
l = []
for i in range(1, 11):
	if a % i == 0:
		l.append(i)
print(l[-1])


t = int(input())
divs = []
for i in range(1, t + 1):
	if t % i == 0:
		divs.append(i)
temp = []
for div in divs:
	if div >= 1 and div <= 10:
		temp.append(div)
print(max(temp))


n = int(input())
j = 1
while j < 10:
	if n % j == 0:
		a = j
	j += 1
print(a)


x = int(input())
i = 1
while i < 10:
	if x % i == 0:
		c = i
	i += 1
print(c)


n = int(input())
i = 10
while i > 0:
	if n % i == 0:
		print(i)
		break
	i -= 1


n = int(input())
for i in range(1, 10):
	if n % i == 0:
		c = i
print(c)


a = int(input())
c = []
for i in range(1, 11):
	if a % i == 0:
		c.append(i)
print(max(c))


n = int(input())
for i in range(9, 0, -1):
	if n % i == 0:
		print(i)
		break


n = int(input())
l1 = []
l2 = []
for i in range(1, n):
	if n % i == 0:
		if i > 0 and i <= 10:
			l1.append(i)
		else:
			l2.append(i)
print(max(l1))


N = int(input())
lst = []
lst2 = []
for i in range(1, N + 1):
	if N % i == 0:
		lst.append(i)
	for i in range(len(lst)):
		if lst[i] < 10:
			lst2.append(lst[i])
print(max(lst2))


n = int(input())
t = [i for i in range(1, 11) if n % i == 0]
t1 = max(t)
print(max(1, t1))


n = int(input())
list_a = []
for i in range(1, 11):
	if n % i == 0:
		list_a.append(i)
print(list_a[-1])


n = int(input())
for i in reversed(range(1, 11)):
	if n % i == 0:
		print(i)
		break