#include <bits/stdc++.h>
using namespace std;
struct cmp {
  bool operator()(const pair<int, int> &a, const pair<int, int> &b) const {
    int lena = a.second - a.first + 1;
    int lenb = b.second - b.first + 1;
    if (lena == lenb) return a.first < b.first;
    return lena > lenb;
  }
};
bool isPrime(int n) {
  for (int i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) return 0;
  }
  return 1;
}
void solve() {
  int n;
  cin >> n;
  set<long long> in;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    in.insert(x);
  }
  cout << (int)in.size() << "\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
