#K73012. Unique IP Visitor Count

    ID: 33881 Type: Default 1000ms 256MiB

Unique IP Visitor Count

Unique IP Visitor Count

In this problem, you are given multiple test cases, each containing a list of IP addresses. Your task is to determine the number of unique IP addresses (visitors) for each test case.

A unique visitor is defined by the distinct IP addresses in the list. Mathematically, if ( S ) is the set of IP addresses for a test case, then the number of unique visitors is ( |S| ), where ( |S| ) denotes the cardinality (size) of the set.

inputFormat

The input begins with an integer ( T ), the number of test cases. For each test case, the first line contains an integer ( N ), the number of IP addresses. The second line contains ( N ) IP addresses separated by spaces.

outputFormat

For each test case, output a single line containing the number of unique IP addresses.## sample

2
5
192.168.0.1 192.168.0.2 192.168.0.1 192.168.0.3 192.168.0.2
3
10.0.0.1 10.0.0.2 10.0.0.1
3

2

</p>