CF1335B Construct the String
题目描述
给你三个正整数 $n,a$ 和 $b$。必须构造一个长度为 $n$ 的字符串 $s$,该字符串由小写英文字母组成,使得字符串 $s$ 中所有长度为 $a$ 的子串正好有 $b$ 个不同的字母。保证答案一定存在。
字符串 $s$ 的字串是指 $s$ 中连续的一段字符,比如 $s_l,s_{l+1},\dots,s_r$ 所构成的字符串就是 $s$ 的一个字串,可以记为 $s[l\dots r]$,这个字串的长度为 $r-l+1$。当然,在本题中,我们只关注长度为 $a$ 的字串。
输入格式
**本题有多组数据。**
第一行一个整数 $t(1\le t\le 2\times 10^3)$,表示数据组数。
接下来 $t$ 行,每行三个整数 $n,a,b(1\le a\le n\le 2\times 10^3,1\le b\le\min(26,a))$,意义如题述。
保证 $\sum n\le 2\times 10^3$。
输出格式
共 $t$ 行,每行一个字符串 $s$,即题中要求构造的字符串。
### 样例第一组数据说明
字符串 $s$ 中共有 $3$ 个长度为 $5$ 的字串:
- `tleel`:共有 $3$ 个不同的字符,符合题意。
- `leelt`:共有 $3$ 个不同的字符,符合题意。
- `eelte`:共有 $3$ 个不同的字符,符合题意。
感谢 @[CSP_Sept](https://www.luogu.com.cn/user/224931) 提供的翻译。
说明/提示
In the first test case of the example, consider all the substrings of length $ 5 $ :
- "tleel": it contains $ 3 $ distinct (unique) letters,
- "leelt": it contains $ 3 $ distinct (unique) letters,
- "eelte": it contains $ 3 $ distinct (unique) letters.