#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int arr[n];
    int m = INT32_MAX;
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      m = min(m, arr[i]);
    }
    int count = 1;
    map<int, int> mp;
    for (int i = 0; i < n; i++) {
      if (arr[i] > m && !mp[arr[i]]) count++;
      mp[arr[i]]++;
    }
    cout << count << "\n";
  }
  return 0;
}
