#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
long long arr[200000 + 2];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    for (long long i = 0; i < n; i++) {
      cin >> arr[i];
    }
    sort(arr, arr + n);
    long long c = arr[0];
    long long cnt = 0;
    map<long long, long long> ms;
    for (long long i = 1; i < n; i++) {
      if (c < arr[i] && ms[arr[i]] != 1) {
        ms[arr[i]] = 1;
        cnt++;
      }
    }
    cout << cnt + 1 << "\n";
  }
}
