#include <bits/stdc++.h>
const int N = (int)1e5;
const long long MOD = (long long)1e18 + 7;
const double pi = 2 * acos(0.0);
const double eps = 1e-9;
static int CASE = 0;
using namespace std;
bool isEqual(double a, double b) { return abs(a - b) <= eps; }
bool isGreater(double a, double b) { return a > b + eps; }
bool isSmaller(double a, double b) { return a + eps < b; }
int dis(int x, int y, int x1, int y1) {
  int res = sqrt(((x - x1) * (x - x1)) + ((y - y1) * (y - y1)));
  return res;
}
long long square(long long a, long long b) { return (a * b); }
long long PowerMod(long long base, long long exp, long long mod) {
  if (exp == 0) return 1 % mod;
  if (exp % 2 == 1) {
    return base * PowerMod(base, exp - 1, mod) % mod;
  } else {
    long long half = PowerMod(base, exp / 2, mod);
    return half * half % mod;
  }
}
long long bigmod(string str) {
  long long res = 0;
  long long len = str.size();
  for (long long i = 0; i < len; i++)
    res = (res * 10 + (long long)str[i] - '0') % 4;
  return res;
}
void execution() {
  long long n;
  cin >> n;
  set<long long> st;
  vector<long long> v(n);
  for (auto &it : v) {
    cin >> it;
    st.insert(it);
  };
  cout << st.size() << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    execution();
  }
  return 0;
}
