Time Limit: 2 second(s) | Memory Limit: 32 MB |
SETI is receiving some weird signals for the past few days. After converting them to our number system they found out that some numbers are repeating. Due to travelling millions of miles signal gets distorted. Now they asked you check the consistency of their data sets. The consistency is that, no number is the prefix another number in that data set. Let's consider a data set:
1. 123
2. 5123456
3. 123456
In this data set, numbers not consistent, because the first number is the prefix of the third one.
Input starts with an integer T (≤ 50), denoting the number of test cases.
Each case starts with an integer n (1 ≤ n ≤ 10000) denoting the total numbers in their list. Each of the next n lines contains one unique phone number. A number is a sequence of digits and has length from 1 to 10.
For each case, print the case number and 'YES' if the list is consistent or 'NO' if it's not.
Sample Input |
Output for Sample Input |
2 3 911 97625999 91125426 5 113 12340 123440 12345 98346 |
Case 1: NO Case 2: YES |
Developed and Maintained by
JANE ALAM JAN |
Copyright © 2012
LightOJ, Jane Alam Jan |