#3256. aab aba baa

0

aab aba baa

aab aba baa

题目描述

在长度为 A+BA + B 且包含 AA 个 aa 与 BB 个 bb 的字符串中,找出按字典序排列第 KK 个的字符串。

输入格式

Input is given from Standard Input in the following format: AA BB KK

输出格式

Print the answer.

2 2 4
baab
30 30 118264581564861424
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

提示

1≤A,B≤301 \leq A, B \leq 30 1≤K≤S1 \leq K \leq S, where SS is the number of strings of length A+BA + B containing AA occurrences of aa and BB occurrences of bb. All values in input are integers.Here are the strings containing two aas and two bbs in the lexicographical order: aabbaabb, abababab, abbaabba, baabbaab, babababa, and bbaabbaa. The fourth string, baabbaab, should be printed.
KK may not fit into a 3232-bit integer type.

标签: AtCoder|abc202D

来源

AtCoder|abc202D