#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    int c[100011] = {0};
    int i;
    for (i = 0; i < n; i++) {
      int a;
      scanf("%d", &a);
      c[a]++;
    }
    int res = 0;
    for (i = 0; i < 100011; i++) {
      if (c[i]) {
        res++;
      }
    }
    printf("%d\n", res);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x61ad0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1259 <main+0x129>
lea    0xe93(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
lea    -0x61ac0(%rbp),%rdi
xor    %esi,%esi
mov    $0x61aac,%edx
call   1040 <memset@plt>
movl   $0x0,-0x61ac4(%rbp)
mov    -0x61ac4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11e1 <main+0xb1>
lea    0xe57(%rip),%rdi
lea    -0x61ac8(%rbp),%rsi
call   1050 <scanf@plt>
movslq -0x61ac8(%rbp),%rax
mov    -0x61ac0(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x61ac0(%rbp,%rax,4)
mov    -0x61ac4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x61ac4(%rbp)
jmp    1193 <main+0x63>
movl   $0x0,-0x61acc(%rbp)
movl   $0x0,-0x61ac4(%rbp)
cmpl   $0x186ab,-0x61ac4(%rbp)
jge    1242 <main+0x112>
movslq -0x61ac4(%rbp),%rax
cmpl   $0x0,-0x61ac0(%rbp,%rax,4)
je     1229 <main+0xf9>
mov    -0x61acc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x61acc(%rbp)
jmp    122e <main+0xfe>
mov    -0x61ac4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x61ac4(%rbp)
jmp    11f5 <main+0xc5>
mov    -0x61acc(%rbp),%esi
lea    0xdb4(%rip),%rdi
call   1030 <printf@plt>
jmp    1152 <main+0x22>
xor    %eax,%eax
add    $0x61ad0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x61ac8,%rsp
lea    0xeb8(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
subl   $0x1,0x8(%rsp)
jae    116d <main+0x3d>
xor    %eax,%eax
add    $0x61ac8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe8c(%rip),%rbx
lea    0x4(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r12
lea    0xe79(%rip),%r13
jmp    11de <main+0xae>
nopl   0x0(%rax)
paddd  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%esi
cmpl   $0x1,0x61ab0(%rsp)
01
sbb    $0xffffffff,%esi
cmpl   $0x1,0x61ab4(%rsp)
01
sbb    $0xffffffff,%esi
cmpl   $0x1,0x61ab8(%rsp)
01
sbb    $0xffffffff,%esi
mov    %r13,%rdi
call   1030 <printf@plt>
subl   $0x1,0x8(%rsp)
jb     1159 <main+0x29>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    $0x61aac,%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
cmpl   $0x0,0x4(%rsp)
jle    122e <main+0xfe>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rax
addl   $0x1,0x10(%rsp,%rax,4)
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     1210 <main+0xe0>
pxor   %xmm2,%xmm2
mov    $0xc,%eax
pxor   %xmm3,%xmm3
pxor   %xmm4,%xmm4
pcmpeqd %xmm5,%xmm5
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movdqa -0x20(%rsp,%rax,4),%xmm0
pcmpeqd %xmm4,%xmm0
paddd  %xmm2,%xmm0
movdqa -0x10(%rsp,%rax,4),%xmm1
pcmpeqd %xmm4,%xmm1
paddd  %xmm3,%xmm1
psubd  %xmm5,%xmm0
psubd  %xmm5,%xmm1
cmp    $0x186ac,%rax
je     1190 <main+0x60>
movdqa (%rsp,%rax,4),%xmm2
pcmpeqd %xmm4,%xmm2
movdqa 0x10(%rsp,%rax,4),%xmm3
pcmpeqd %xmm4,%xmm3
paddd  %xmm2,%xmm0
psubd  %xmm5,%xmm0
paddd  %xmm3,%xmm1
psubd  %xmm5,%xmm1
add    $0x10,%rax
movdqa %xmm0,%xmm2
movdqa %xmm1,%xmm3
jmp    1250 <main+0x120>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100011 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %9
9: ; preds = %47, %0
%10 = load i32, i32* %2
%11 = add nsw i32 %10, -1
store i32 %11, i32* %2
%12 = icmp ne i32 %10, 0
br i1 %12, label %13, label %50
13: ; preds = %9
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%15 = bitcast [100011 x i32]* %4 to i8*
store i32 0, i32* %5
br label %16
16: ; preds = %27, %13
%17 = load i32, i32* %5
%18 = load i32, i32* %3
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %30
20: ; preds = %16
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [100011 x i32], [100011 x i32]* %4, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = add nsw i32 %25, 1
store i32 %26, i32* %24
br label %27
27: ; preds = %20
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %16
30: ; preds = %16
store i32 0, i32* %7
store i32 0, i32* %5
br label %31
31: ; preds = %44, %30
%32 = load i32, i32* %5
%33 = icmp slt i32 %32, 100011
br i1 %33, label %34, label %47
34: ; preds = %31
%35 = load i32, i32* %5
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [100011 x i32], [100011 x i32]* %4, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %34
%41 = load i32, i32* %7
%42 = add nsw i32 %41, 1
store i32 %42, i32* %7
br label %43
43: ; preds = %40, %34
br label %44
44: ; preds = %43
%45 = load i32, i32* %5
%46 = add nsw i32 %45, 1
store i32 %46, i32* %5
br label %31
47: ; preds = %31
%48 = load i32, i32* %7
%49 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %48)
br label %9
50: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100011 x i32]
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = add nsw i32 %7, -1
store i32 %8, i32* %1
%9 = icmp eq i32 %7, 0
br i1 %9, label %84, label %10
10: ; preds = %0
%11 = bitcast i32* %2 to i8*
%12 = bitcast [100011 x i32]* %3 to i8*
%13 = bitcast i32* %4 to i8*
%14 = getelementptr inbounds [100011 x i32], [100011 x i32]* %3, i64 0, i64 100008
%15 = getelementptr inbounds [100011 x i32], [100011 x i32]* %3, i64 0, i64 100009
%16 = getelementptr inbounds [100011 x i32], [100011 x i32]* %3, i64 0, i64 100010
br label %17
17: ; preds = %10, %65
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%19 = load i32, i32* %2
%20 = icmp sgt i32 %19, 0
br i1 %20, label %54, label %21
21: ; preds = %54, %17
br label %22
22: ; preds = %40, %21
%23 = phi i64 [ 0, %21 ], [ %53, %40 ]
%24 = phi <4 x i32> [ zeroinitializer, %21 ], [ %51, %40 ]
%25 = phi <4 x i32> [ zeroinitializer, %21 ], [ %52, %40 ]
%26 = getelementptr inbounds [100011 x i32], [100011 x i32]* %3, i64 0, i64 %23
%27 = bitcast i32* %26 to <4 x i32>*
%28 = load <4 x i32>, <4 x i32>* %27
%29 = getelementptr inbounds i32, i32* %26, i64 4
%30 = bitcast i32* %29 to <4 x i32>*
%31 = load <4 x i32>, <4 x i32>* %30
%32 = icmp ne <4 x i32> %28, zeroinitializer
%33 = icmp ne <4 x i32> %31, zeroinitializer
%34 = zext <4 x i1> %32 to <4 x i32>
%35 = zext <4 x i1> %33 to <4 x i32>
%36 = add <4 x i32> %24, %34
%37 = add <4 x i32> %25, %35
%38 = or i64 %23, 8
%39 = icmp eq i64 %38, 100008
br i1 %39, label %65, label %40
40: ; preds = %22
%41 = getelementptr inbounds [100011 x i32], [100011 x i32]* %3, i64 0, i64 %38
%42 = bitcast i32* %41 to <4 x i32>*
%43 = load <4 x i32>, <4 x i32>* %42
%44 = getelementptr inbounds i32, i32* %41, i64 4
%45 = bitcast i32* %44 to <4 x i32>*
%46 = load <4 x i32>, <4 x i32>* %45
%47 = icmp ne <4 x i32> %43, zeroinitializer
%48 = icmp ne <4 x i32> %46, zeroinitializer
%49 = zext <4 x i1> %47 to <4 x i32>
%50 = zext <4 x i1> %48 to <4 x i32>
%51 = add <4 x i32> %36, %49
%52 = add <4 x i32> %37, %50
%53 = add nuw nsw i64 %23, 16
br label %22
54: ; preds = %17, %54
%55 = phi i32 [ %62, %54 ], [ 0, %17 ]
%56 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%57 = load i32, i32* %4
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [100011 x i32], [100011 x i32]* %3, i64 0, i64 %58
%60 = load i32, i32* %59
%61 = add nsw i32 %60, 1
store i32 %61, i32* %59
%62 = add nuw nsw i32 %55, 1
%63 = load i32, i32* %2
%64 = icmp slt i32 %62, %63
br i1 %64, label %54, label %21
65: ; preds = %22
%66 = add <4 x i32> %37, %36
%67 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %66)
%68 = load i32, i32* %14
%69 = icmp ne i32 %68, 0
%70 = zext i1 %69 to i32
%71 = add nuw nsw i32 %67, %70
%72 = load i32, i32* %15
%73 = icmp ne i32 %72, 0
%74 = zext i1 %73 to i32
%75 = add nuw nsw i32 %71, %74
%76 = load i32, i32* %16
%77 = icmp ne i32 %76, 0
%78 = zext i1 %77 to i32
%79 = add nuw nsw i32 %75, %78
%80 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %79)
%81 = load i32, i32* %1
%82 = add nsw i32 %81, -1
store i32 %82, i32* %1
%83 = icmp eq i32 %81, 0
br i1 %83, label %84, label %17
84: ; preds = %65, %0
ret i32 0
}