{"problem":{"name":"D. Different vectors","description":{"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..","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":65536},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10020D"},"statements":[{"statement_type":"Markdown","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## Input\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\n## Output\n\nOutput one number: the number of different vectors.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**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 $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10020D","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}