Preparando MOJI

Codeforces Subsequences

2000ms 524288K

Description:

Karl likes Codeforces and subsequences. He wants to find a string of lowercase English letters that contains at least $$$k$$$ subsequences codeforces. Out of all possible strings, Karl wants to find a shortest one.

Formally, a codeforces subsequence of a string $$$s$$$ is a subset of ten characters of $$$s$$$ that read codeforces from left to right. For example, codeforces contains codeforces a single time, while codeforcesisawesome contains codeforces four times: codeforcesisawesome, codeforcesisawesome, codeforcesisawesome, codeforcesisawesome.

Help Karl find any shortest string that contains at least $$$k$$$ codeforces subsequences.

Input:

The only line contains a single integer $$$k$$$ ($$$1 \leq k \leq 10^{16})$$$.

Output:

Print a shortest string of lowercase English letters that contains at least $$$k$$$ codeforces subsequences. If there are several such strings, print any of them.

Sample Input:

1

Sample Output:

codeforces

Sample Input:

3

Sample Output:

codeforcesss

Informação

Codeforces

Provedor Codeforces

Código CF1368B

Tags

brute forceconstructive algorithmsgreedymathstrings

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 10:03:44

Relacionados

Nada ainda