{"raw_statement":[{"iden":"statement","content":"You are given a set of N vectors, each vector consists of K integers. Vector X is equivalent to Y (denoted X ≡ Y) iff there exist a bijection  and an integer r, such that  for each i in the range [0..K - 1].\n\nFor example, (1, 2, 2, 3) ≡ (22, 3, 4, 22), with r = 2 and f(22) = 2, f(3) = 3 and f(4) = 1. But (22, 3, 22, 4) is not equivalent to (1, 2, 2, 3).\n\nHow many pairwise nonequivalent vectors are there in a given set of N vectors?\n\nFirst number contains T (T ≤ 10), number of test cases. Each test case consists of the following. First line consists of N and K (1 ≤ N ≤ 10000, 1 ≤ K ≤ 100). N lines follow, the i-th containing K integers describing the i-th vector. The vector values are from the range [0, 109].\n\nOutput one number: the number of different vectors.\n\n"},{"iden":"input","content":"First number contains T (T ≤ 10), number of test cases. Each test case consists of the following. First line consists of N and K (1 ≤ N ≤ 10000, 1 ≤ K ≤ 100). N lines follow, the i-th containing K integers describing the i-th vector. The vector values are from the range [0, 109]."},{"iden":"output","content":"Output one number: the number of different vectors."},{"iden":"examples","content":"Input23 422 3 4 221 2 2 322 3 22 45 53 3 3 0 38 4 4 4 01 1 1 1 11 1 8 6 11 3 3 3 5Output23"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ T \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case, let $ N, K \\in \\mathbb{Z} $ denote the number of vectors and their dimension, respectively.  \nLet $ V = \\{v_1, v_2, \\dots, v_N\\} $ be the set of vectors, where each $ v_i \\in \\mathbb{Z}^K $.\n\n**Equivalence Relation**  \nTwo vectors $ u, v \\in \\mathbb{Z}^K $ are equivalent ($ u \\equiv v $) if there exists a bijection $ f: \\text{Range}(u) \\cup \\text{Range}(v) \\to \\mathbb{Z} $ and an integer $ r \\in \\mathbb{Z} $ such that for all $ i \\in \\{0, 1, \\dots, K-1\\} $:  \n$$\nf(u_i) = v_i + r\n$$\n\n**Constraints**  \n1. $ 1 \\le T \\le 10 $  \n2. For each test case:  \n   - $ 1 \\le N \\le 10000 $  \n   - $ 1 \\le K \\le 100 $  \n   - Each component of every vector satisfies $ 0 \\le v_{i,j} \\le 10^9 $\n\n**Objective**  \nCompute the number of equivalence classes in $ V $ under $ \\equiv $.","simple_statement":"Given N vectors, each with K integers. Two vectors are equivalent if you can map one to the other by renaming values (bijection) and adding the same constant to all elements. Count how many non-equivalent vectors there are.","has_page_source":false}