Codeforces Round 431 (Div. 2)
C
From Y to Y
Codeforces
未评级
原题
← BD →
翻译中…

From beginning till end, this message has been waiting to be conveyed.

翻译中…

For a given unordered multiset of $*n*$ lowercase English letters ("multi" means that a letter may appear more than once), we treat all letters as strings of length $1$, and repeat the following operation $*n* - 1$ times:

翻译中…
  • Remove any two elements $*s*$ and $*t*$ from the set, and add their concatenation $*s* + *t*$ to the set.
翻译中…

The cost of such operation is defined to be image, where $*f*(*s*, *c*)$ denotes the number of times character $*c*$ appears in string $*s*$.

翻译中…

Given a non-negative integer $*k*$, construct any valid non-empty set of no more than $100 000$ letters, such that the minimum accumulative cost of the whole process is exactly $*k*$. It can be shown that a solution always exists.

翻译中…

Input

翻译中…

The first and only line of input contains a non-negative integer $*k*$ ($0 ≤ *k* ≤ 100 000$) — the required minimum cost.

翻译中…

Output

翻译中…

Output a non-empty string of no more than $100 000$ lowercase English letters — any multiset satisfying the requirements, concatenated to be a string.

翻译中…

Note that the printed string doesn't need to be the final concatenated string. It only needs to represent an unordered multiset of letters.

翻译中…

Note

翻译中…

For the multiset {'a', 'b', 'a', 'b', 'a', 'b', 'a', 'b'}, one of the ways to complete the process is as follows:

翻译中…
  • {"ab", "a", "b", "a", "b", "a", "b"}, with a cost of $0$;
  • {"aba", "b", "a", "b", "a", "b"}, with a cost of $1$;
  • {"abab", "a", "b", "a", "b"}, with a cost of $1$;
  • {"abab", "ab", "a", "b"}, with a cost of $0$;
  • {"abab", "aba", "b"}, with a cost of $1$;
  • {"abab", "abab"}, with a cost of $1$;
  • {"abababab"}, with a cost of $8$.
翻译中…

The total cost is $12$, and it can be proved to be the minimum cost of the process.

翻译中…

样例

Input #1
12
Output #1
abababab
InputCopy OutputCopy
Input #2
3
Output #2
codeforces
InputCopy OutputCopy
题目信息
题号
849C
时间限制
1 s
内存限制
256 MB

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。