{"trustable":false,"sections":[{"title":"","value":{"format":"MD","content":"Sumi, a diligent student, has been assigned the task of verifying the consistency of student IDs in her class. Each student has a unique ID number, and Sumi\u0027s goal is to ensure that no student ID is the prefix of another student\u0027s ID in the list.\n\nA student ID is considered a prefix duplicate if it is the beginning (prefix) of another longer ID. Sumi needs to identify if there are any such cases of prefix duplication.\n\nFor example, consider the following student IDs:\n\n9876\n234\n9876543\nIn this case, the IDs are not consistent, because the ID 9876 is a prefix of the ID 9876543.\n\nTask:\nSumi needs to check multiple data sets containing student IDs and determine whether the IDs in each set are consistent. A data set is consistent if no student ID is the prefix of another student\u0027s ID.\n"}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026le; 50)**, denoting the number of test cases.\n\nEach case starts with an integer **n (1 \u0026le; n \u0026le; 10000)** denoting the total numbers in their list. Each of the next **n** lines contains one unique ID. A ID is a sequence of digits and has length from **1** to **10**."}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number and `YES` if the list is consistent or `NO` if it\u0027s not."}},{"title":"Sample","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\n3\n911\n97625999\n91125426\n5\n113\n12340\n123440\n12345\n98346\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: NO\nCase 2: YES\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}