#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, ans;
  cin >> t;
  while (t--) {
    ans = 1;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    int i = 1, curr_cnt = 1;
    while (i < n) {
      if (a[i] > a[i - 1]) {
        curr_cnt++;
      }
      i++;
    }
    ans = max(curr_cnt, ans);
    cout << ans << "\n";
  }
}
