#Lutece0445. Shortest String
Shortest String
Migrated from Lutece 445 Shortest String
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
NEW is depressed by his fault in the online-contest, so he is determing to read dozens of problems to hence his ability of setting a question ( ̄. ̄)+ .
But, as you see, NEW's english is really poor, and reading a long passage is hard for him ╮(╯_╰)╭ .
In order to achieve his goal, NEW dicided to make full use of his strange talent to read strings together ( ̄︶ ̄)↗ , which leads to the problem list below: Here comes strings , NEW wanna make a new string B which contains and (It means that are all B's substring). Please help NEW to figure out the minimum length of . (>﹏<)
Input
There are several test cases.
One interger () is given in the first line
Then following lines, each line contains one string. (The whole length of string is less than )
Output
One line for each case, the minimum length of
Samples
3
abac
acd
cdb
6
Note
In the sample, is abacdb
which have minimum length.
Resources
5th BUPT Programming Contest Final