QOJ.ac

QOJ

実行時間制限: 1.0 s メモリ制限: 512 MB 満点: 100

#12943. 之字形名牌

統計

当忍者参加会议时,他们会佩戴伪造的姓名牌。其中一位忍者特别想给他的老师留下深刻印象。

他的老师每天都会选择一个新的幸运数字。这位学生想在他的姓名牌上写一个名字,使其编码结果等于老师的幸运数字!这个名字仅由小写字母组成。他根据字母在字母表中的位置为每个字母分配一个值(例如 $a = 1, b = 2, \dots, z = 26$)。然后,他通过将每对相邻字母之差的绝对值相加来对老师的数字进行编码。例如,字符串 azxb 的值为:

$$|a - z| + |z - x| + |x - b| = |1 - 26| + |26 - 24| + |24 - 2| = 49$$

忍者写在姓名牌上的名字是编码结果等于老师幸运数字的最短字符串。如果存在多个长度相同的最短字符串,他会选择字典序最小的那一个。给定老师的幸运数字 $k$,请找出忍者应该写在姓名牌上的字符串。

输入格式

每个输入包含一个测试用例。请注意,你的程序可能会在不同的输入上多次运行。每个输入包含一行,其中有一个整数 $k$ ($1 \le k \le 1\,000\,000$),即老师的幸运数字。保证一定存在一个编码结果等于老师数字的名字。

输出格式

输出一行小写字母字符串,即忍者为了给老师留下深刻印象而应该写在姓名牌上的名字。

样例

输入 1

1

输出 1

ab

输入 2

19

输出 2

at

输入 3

77

输出 3

aoazb

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.