Shivam is working on electric circuits. He requires some connecting wires. He needs to make a total of N connections and he has mentioned his wire length requirements for each connection in an integer sequence A. For buying wires, he need to decide the length of each wire piece, and he’ll get as many wire pieces of the chosen length each at unit cost (cost 1 per piece) but he can't get wires of different lengths. Also, he can't cut wire pieces to make new pieces of different (smaller) length(s).
But he can connect any number of wires together to form a new single wire piece whose length is the sum of lengths of the wires connected. So, Shivam needs to choose an integer length for buying wires. Shivam hates to waste anything, and he hates it even more if that thing is money.
Shivam is weak in mathematics and is asking you to help him in this situation. Help him decide the length of wires and total number of wires so as to minimize the total expenditure.
Note: You cannot make a connection which requires a wire piece of length X with a wire piece of length Y if X≠Y.
Input:
·        The first line of the input contains T = Number of Test cases
·        The first line of each test case contains an integer N
·        The second line contains N space separated integers A1, A2, …., AN.
Output:
For each test case print a single line containing two space separated integers, length of each wire and the corresponding minimum cost.
Constraints:
·       1 <= T <= 10
·       1 <= N <= 10^5
·        1 <= Ai <= 10^5, for each valid i
Sample Input:
1
3
2 4 8
Sample Output:
2 7
# cook your dish here
def find_gcd(x, y): 
 while(y): 
  x, y = y, x % y 
 
 return x 
n=int(input())
for i in range(n):
 n1=int(input())
 l=list(map(int,input().split()))
 if(n1==1):
  print(l[0],1)
 else:    
  num1=l[0] 
  num2=l[1] 
  gcd=find_gcd(num1,num2) 
  for i in range(2,len(l)): 
   gcd=find_gcd(gcd,l[i]) 
  sum1=0 
  for i in range(n1):
   sum1+=(l[i]//gcd)
  print(gcd,int(sum1)) 

# cook your dish here
def find_gcd(x, y): 
 while(y): 
  x, y = y, x % y 
 
 return x 
n=int(input())
for i in range(n):
 n1=int(input())
 l=list(map(int,input().split()))
 if(n1==1):
  print(l[0],1)
 else:    
  num1=l[0] 
  num2=l[1] 
  gcd=find_gcd(num1,num2) 
  for i in range(2,len(l)): 
   gcd=find_gcd(gcd,l[i]) 
  sum1=0 
  for i in range(n1):
   sum1+=(l[i]//gcd)
  print(gcd,int(sum1)) 
