CodeForces - 798B:Mike and strings
来源:
标签:
参考资料:
相似题目:
题目
Mike has n strings s1, s2, …, sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and append it to the end of the string. For example, if he has the string “coolmike”, in one move he can transform it into the string “oolmikec”.
Now Mike asks himself: what is minimal number of moves that he needs to do in order to make all the strings equal?
输入
The first line contains integer n (1 ≤ n ≤ 50) — the number of strings.
This is f