Skip to content

Commit b08b501

Browse files
Chef and Linear Chess
1 parent 651c6e6 commit b08b501

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
for _ in range(int(input())):
2+
n1,k=input().split()
3+
k=int(k)
4+
a=map(int,input().split())
5+
l=[]
6+
for i in a:
7+
if k%i==0:
8+
l.append(i)
9+
l.sort(reverse=True)
10+
if len(l)==0:
11+
print(-1)
12+
else:
13+
print(l[0])

0 commit comments

Comments
 (0)