Created
December 30, 2018 10:11
-
-
Save sysuin/9af1f6d838e29cb7a941f2c74700dc00 to your computer and use it in GitHub Desktop.
Geeksforgeeks Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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