QOJ.ac

QOJ

시간 제한: 1.0 s 메모리 제한: 1024 MB 총점: 100 난이도: [표시] 해킹 가능 ✓

#17753. 来自陈教授的问候

통계

欢迎来到香港中文大学(深圳)!陈教授喜欢使用仅由小写英文字母组成的字符串来发送问候。

给定一个整数 $n$,请构造一个仅由小写英文字母组成的字符串,使得其所有字符的 ASCII 码之和等于 $n$。

输入格式

每个输入文件包含多个测试用例。输入的第一行包含一个整数 $T$ ($1 \le T \le 5 \times 10^3$),表示测试用例的数量。对于每个测试用例:

唯一的一行包含一个整数 $n$ ($1 \le n \le 10^7$)。

保证所有测试用例中 $n$ 的总和不超过 $10^7$。

输出格式

对于每个测试用例:

  • 如果可以构造一个仅由小写英文字母组成且 ASCII 码之和等于 $n$ 的字符串,首先单行输出 Yes。接着在第二行输出该字符串。
  • 否则,如果无法构造,则只需单行输出 No

样例

输入样例 1

3
2257
2269
96

输出样例 1

Yes
greetingsfromprofchen
Yes
welcometocuhkshenzhen
No

说明

以下是小写英文字母的 ASCII 码表:

字母 ASCII 字母 ASCII 字母 ASCII
a 97 j 106 s 115
b 98 k 107 t 116
c 99 l 108 u 117
d 100 m 109 v 118
e 101 n 110 w 119
f 102 o 111 x 120
g 103 p 112 y 121
h 104 q 113 z 122
i 105 r 114

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.