#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> V;
int solve() {
  V.clear();
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    V.emplace_back(a);
  }
  sort(V.begin(), V.end());
  V.erase(unique(V.begin(), V.end()), V.end());
  return V.size();
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) cout << solve() << '\n';
}
