#abc202d. D - aab aba baa
D - aab aba baa
Score : points
问题描述
在包含 个 a
和 个 b
的长度为 的字符串中,找出第 个字典序排列的字符串。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Among the strings of length containing occurrences of a
and occurrences of b
, find the string that comes -th in the lexicographical order.
Constraints
- , where is the number of strings of length containing occurrences of
a
and occurrences ofb
. - All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
2 2 4
Sample Output 1
baab
Here are the strings containing two a
s and two b
s in the lexicographical order: aabb
, abab
, abba
, baab
, baba
, and bbaa
. The fourth string, baab
, should be printed.
Sample Input 2
30 30 118264581564861424
Sample Output 2
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
may not fit into a -bit integer type.
update @ 2024/3/10 09:14:32