Skip to content

Instantly share code, notes, and snippets.

@sysuin
Created December 30, 2018 10:11
Show Gist options
  • Save sysuin/9af1f6d838e29cb7a941f2c74700dc00 to your computer and use it in GitHub Desktop.
Save sysuin/9af1f6d838e29cb7a941f2c74700dc00 to your computer and use it in GitHub Desktop.
Geeksforgeeks Test
test = int(input())
for i in range(test):
n = int(input())
if len(str(n))==1:
print(n)
else:
arr = []
for x in range(2,int(n/2)+2):
if n%x==0:
r = int(n/x)
arr.append(int(str(x) + "" + str(r)))
continue
else:
print(-1)
print(min(arr))
##################################################################
for x in range(test):
in_arr = []
len = int(input())
arr = input().split()
for k in range(len):
for j in range(2,(arr[k])/2):
if arr[k]%j==0:
in_arr.append(j)
print(min(in_arr))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment