#include #include #include #include #include #include #include #include #include #include #include #include #include #define inf 0x7fffffff #define mod 10000 #define met(a,b) memset(a,b,sizeof a) typedef long long ll; using namespace std; const int N = 100; const int M = 100000; const int INF = 0x3f3f3f3f; int x; int n, a[100002], b[100002]; int main() { int t; scanf("%d", &t); while(t--) { scanf("%d", &n); memset(a, 0, sizeof(a)); memset(b, 0, sizeof(b)); for(int i = 0; i < n; i++) { scanf("%d", &b[i]); a[b[i]]++; } int c[1000]; int ans = 0; for(int i = 1; i*i <= n; i++) { if(i*i == n) c[++ans] = i; else if(n%i == 0) { c[++ans] = i; c[++ans] = n/i; } } sort(c+1, c+1+ans); for(int i = 1; i <= ans; i++) { int flag = 1; for(int j = 1; j <= n; j++) { if(a[j] > 0 && a[j]%c[i] != 0) { flag = 0; break; } } if(!flag) c[i] = -1; } int first = 1; for(int i = ans; i >= 1; i--) { if(c[i] > 0) { if(first) { first = 0; printf("%d", n/c[i]); } else printf(" %d", n/c[i]); } } printf("\n"); } }