欢迎来到起遇信息学
起遇信息学正处于上线筹建阶段,以下功能已全部开放免费体验: ✅ 完整题库浏览与代码提交评测(C / C++ / Python / Java 等) ✅ 入门到进阶的系列课程试读、作业与考试 ✅ AI 提示、AI 作业分析等智能助教功能 ✅ 赛事模拟与个人能力报告 ✅ 邮箱注册开放 ⏳ 付费课程订阅与微信/支付宝支付通道 ⏳ 手机号登录,微信扫码登录、微信公众号绑定 使用中如遇任何问题,欢迎通过页面底部 **"联系我们"** 与我们沟通。
CF1092A.Uniform String
Uniform String
You are given two integers and .
Your task is to construct such a string of length that for each from to there is at least one -th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letters except these. You have to maximize the minimal frequency of some letter (the frequency of a letter is the number of occurrences of this letter in a string). If there are several possible answers, you can print any.
You have to answer independent queries.
Input
The first line of the input contains one integer () — the number of queries.
The next lines are contain queries, one per line. The -th line contains two integers and () — the length of the string in the -th query and the number of characters in the -th query.
Output
Print lines. In the -th line print the answer to the -th query: any string satisfying the conditions in the problem statement with constraints from the -th query.
Note
In the first example query the maximum possible minimal frequency is , it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).
In the second example query any permutation of first four letters is acceptable (the maximum minimal frequency is ).
In the third example query any permutation of the given answer is acceptable (the maximum minimal frequency is ).
Samples
3
7 3
4 4
6 2
cbcacab
abcd
baabab
在线编程 IDE
建议全屏模式获得最佳体验
| 进入全屏编程 | Alt+E |
| 递交评测 | Ctrl+Enter |
| 注释/取消注释 | Ctrl+/ |
| 缩放字体 | Ctrl+滚轮 |