QOJ.ac

QOJ

时间限制: 1.0 s 内存限制: 256 MB 总分: 100 可 Hack ✓

#10837. aaaaaaaaaaA heH heH nuN

统计

Vasily Tadokorov 是一位字符串专家。他认为一个字符串是“芬芳的”(fragrant),如果它可以被分为两部分:前缀为 nunhehheh,后缀为若干个(至少一个)a。例如,nunhehheaaaaaa 是芬芳的,但 nunhehhehnunhehhehoooaaa 不是。

今天,Vasily Tadokorov 有一些由小写英文字母组成的字符串。对于每个字符串,他想知道其中有多少个子序列是芬芳的。如果字符串 $a$ 可以通过删除字符串 $b$ 中的若干个(包括 0 个)字符得到,则称 $a$ 是 $b$ 的子序列。

上述问题是 Vasily 想出的一个字符串问题。众所周知,一个问题通常会有几个样例以供更好地理解。然而,Vasily 在制作芬芳的样例时遇到了困难。在 2000 年后,他终于制作了两个完美的样例,如下所示。

样例 1: 输入:nunhehhehahaahahahahahahaahaahahahahha 输出:114514

样例 2: 输入:nunhehhehhehhahaahahahaahaahahaaaahaa 输出:1919810

Vasily 不够聪明。他不想再工作 2000 年,所以他请求你的帮助。他给你 $T$ 个任务,每个任务包含一个整数 $n$,你需要构造一个仅由小写英文字母组成的字符串,使其恰好包含 $n$ 个芬芳的子序列。

输入格式

第一行包含一个整数 $T$ ($1 \le T \le 1000$),表示任务数量。 接下来的 $T$ 行,每行包含一个整数 $n$ ($0 \le n \le 10^9$)。

输出格式

对于每个测试用例,输出一行仅由小写英文字母组成的字符串作为答案。你需要确保所有输出字符串的长度之和不超过 $10^6$。可以证明解总是存在的。如果存在多个解,输出任意一个即可。

样例

输入格式 1

114514

输出格式 1

nunhehhehahaahahahahahahaahaahahahahha

输入格式 2

1919810

输出格式 2

nunhehhehhehhahaahahahaahaahahaaaahaa

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.