def solve():
T = int(input()) # number of test cases
for _ in range(T):
N = int(input()) # length of the array
A = list(map(int, input().split())) # the array itself
# Sort the array first
A.sort()
# Try to find the maximum number of partitions
max_partitions = 1 # At least one partition will always be possible
for k in range(2, N + 1): # k is the partition size
if N % k == 0: # Only consider k that divides N
valid = True
# Check if the difference between max and min is the same for all subarrays
diff = A[k-1] - A[0] # Initial difference in the first partition
for i in range(k, N, k):
if A[i+k-1] - A[i] != diff:
valid = False
break
if valid:
max_partitions = max(max_partitions, N // k)
# Output the result for this test case
print(max_partitions)