4604: Constructing a string
内存限制:128 MB
时间限制:1 S
标准输入输出
题目类型:传统
评测方式:Special Judge
上传者:
提交:15
通过:5
题目描述
Given a string t consisting of lowercase letters with a length of n and an integer k.
Please construct a string s with the following requirements:
字符串 s 恰好有 k 个子串等于字符串 t。
The length of string s should be as short as possible.
It is guaranteed that there exists a unique solution.
Please construct a string s with the following requirements:
字符串 s 恰好有 k 个子串等于字符串 t。
The length of string s should be as short as possible.
It is guaranteed that there exists a unique solution.
输入格式
The first line contains twointegers n, k.
The second line contains a length n , a lowercase string t。
The second line contains a length n , a lowercase string t。
输出格式
Output the string s that satisfies the given conditions.
It is guaranteed that there exists a unique solution.
It is guaranteed that there exists a unique solution.
输入样例 复制
3 4
aba
输出样例 复制
ababababa
数据范围与提示
1≤n,k≤50