PCPC12J  Amr Samir
Amr started to learn division. So he gave a list of numbers to his friend and asked him to find all the divisors of each number in the given list. Now Amr has a new list of numbers containing all divisors of his original list.
As Amr loves playing with numbers, he now thinks about the repeated numbers in the new list of divisors. However this time Amr is interested in the luckiest divisor!
Lucky divisor is defined by Amr as follows: a divisor D is lucky if D divides f, where f is the frequency of this number D in the new list. Obviously f must be greater than zero.
The luckiest divisor is the divisor D that divides f where f is the maximum and D is the smallest one.
Since Amr is too lazy to write a program that solves this problem, he decided to submit it to the PCPC chief judge to put it as a problem for the teams to write a solution to it. Can you write this program for Amr?
Input Specification
The first line contains a positive integer t <= 100, then follow t test cases. Each test case start with a line containing a single positive integer n <= 10000 number of divisors in Amr’s new list, then follows n positive integers a1, ai, …an (ai<= 100).
Output Specification
Your code should print an integer for each test case representing the luckiest divisor or 1 if there is no lucky divisor.
Sample Input
2
5
2 2 3 3 3
7
2 2 2 2 3 3 3
Sample Output
3
2
hide comments
pulkitgulati:
20160704 20:13:57
Last edit: 20161216 11:37:44 

mkfeuhrer:
20160617 11:46:50
hashing !! easy :) 

KD :
20160526 19:05:39
hashing rocks!!!!! AC in one go 

Beta Projects:
20151012 10:06:55
@abhi_vicky: 2 

abhi_vicky:
20150818 20:11:23
what is the output of


anuveshkothari:
20150817 12:33:43
@jaydeep \n after each test case Last edit: 20150817 12:34:00 

Anant Upadhyay:
20150816 18:01:48
easy logic.... Last edit: 20150816 18:07:31 

Jaydeep Khandelwal:
20150816 12:13:07
in output, after each test case \n or \n\n ????????


anuveshkothari:
20150814 00:34:13
@rohit comment helps


adi_tri:
20150813 21:22:49
accepted in one go.......:) 
Added by:  abdelkarim 
Date:  20121228 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  The First Palestinian Collegiate Programming Contest 