#P12454. [INOI Team Selection 2021] String
[INOI Team Selection 2021] String
题目描述
Mikaeel has got strings named each consists of lower-case English letters. He wants to pick a non-empty substring of each one and concatenate them together to make a final string of size . Help Mikaeel create the smallest lexicographical string possible.
输入格式
In the first line, you are given two integers and , the number of strings and the size of the final string, respectively.
The following lines contain the sequence , the strings of Mikaeel.
输出格式
In a single line, print the smallest lexicographical string achievable.
3 5
abc
xxx
aaa
abcxa
5 6
ab
bz
zb
aa
cb
abbaab
提示
Constraints
Subtasks
subtask | score | limits |
---|---|---|
1 | 23 | $\forall_{1 \leq i \leq n}, \vert s_{i}\vert = \vert s_{1}\vert \leq 10$, |
2 | 19 | $\forall_{1 \leq i \leq n}, \vert s_{i}\vert = \vert s_{1} \vert \leq 20$, |
3 | 58 | No extra limits |