#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    set<int, greater<int>> check;
    for (int i = 0; i < n; i++) {
      int x;
      cin >> x;
      check.insert(x);
    }
    cout << check.size() << "\n";
  }
}
