#abc366b. B - Vertical Writing
B - Vertical Writing
Score : points
问题陈述
你得到了一段水平书写的文本。将其转换为垂直书写,用
*
填充空格。
你得到了 个字符串 ,它们由小写英文字母组成。设 为这些字符串的最大长度。
打印出 个字符串 ,满足以下条件:
- 每个 由小写英文字母和
*
组成。 - 每个 不以
*
结尾。 - 对于每个 ,以下条件成立:
- 对于每个 , 的第 个字符存在,并且按顺序连接 的第 个字符等于 。
- 对于每个 , 的第 个字符要么不存在,要么是
*
。
在这里, 表示字符串 的长度。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
You are given a horizontally written text. Convert it to vertical writing, filling spaces with
*
.
You are given strings consisting of lowercase English letters. Let be the maximum length of these strings.
Print strings that satisfy the following conditions:
- Each consists of lowercase English letters and
*
. - Each does not end with
*
. - For each , the following holds:
- For each , the -th character of exists, and the concatenation of the -th characters of in this order equals .
- For each , the -th character of either does not exist or is
*
.
Here, denotes the length of the string .
Constraints
- is an integer between and , inclusive.
- Each is a string of lowercase English letters with length between and , inclusive.
Input
The input is given from Standard Input in the following format:
Output
Print the answer in the following format:
Sample Input 1
3
abc
de
fghi
Sample Output 1
fda
geb
h*c
i
Placing *
as the 2nd character of puts the c
in the correct position. On the other hand, placing *
as the 2nd and 3rd characters of would make end with *
, which violates the condition.
Sample Input 2
3
atcoder
beginner
contest
Sample Output 2
cba
oet
ngc
tio
end
sne
ter
*r