传统题 1000ms 256MiB

D - aab aba baa

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

D - aab aba baa

Score : $400$ points

Problem Statement

Among the strings of length $A + B$ containing $A$ occurrences of a and $B$ occurrences of b, find the string that comes $K$-th in the lexicographical order.

Constraints

  • $1 \leq A, B \leq 30$
  • $1 \leq K \leq S$, where $S$ is the number of strings of length $A + B$ containing $A$ occurrences of a and $B$ occurrences of b.
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

AA BB KK

Output

Print the answer.


2 2 4
baab

Here are the strings containing two as and two bs in the lexicographical order: aabb, abab, abba, baab, baba, and bbaa. The fourth string, baab, should be printed.


30 30 118264581564861424
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

$K$ may not fit into a $32$-bit integer type.

2024寒假入门组刷题营(十四)

未参加
状态
已结束
规则
ACM/ICPC
题目
8
开始于
2024-2-14 13:30
结束于
2024-2-14 15:30
持续时间
2 小时
主持人
参赛人数
9