题库练习 Bear and String Distance
← 上一题 下一题 →

A10195 | Bear and String Distance

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

Limak is a little polar bear. He likes nice strings — strings of length $n$ , consisting of lowercase English letters only.

The distance between two letters is defined as the difference between their positions in the alphabet. For example, ![](/uploads/luogu/CF628C/8da66884325cabbb3822b7a59fabab06b8c9aecb_1f00d0c875d4.png), and ![](/uploads/acgo/image/5a479836cbe05c42_28d2fe071b3d.jpeg).

Also, the distance between two nice strings is defined as the sum of distances of corresponding letters. For example, ![](/uploads/luogu/CF628C/88d3180afa5197edf3d9181b6092568129b849de_c2d3cae5aa9e.png), and ![](/uploads/acgo/image/9ce4275c093465df_cfa1cf62f5e5.jpeg).

Limak gives you a nice string $s$ and an integer $k$ . He challenges you to find any nice string $s'$ that ![](/uploads/acgo/image/7f2aefbd083611fa_e796f4d09c11.jpeg). Find any $s'$ satisfying the given conditions, or print "-1" if it's impossible to do so.

As input/output can reach huge size it is recommended to use fast input/output methods: for example, prefer to use gets/scanf/printf instead of getline/cin/cout in C++, prefer to use BufferedReader/PrintWriter instead of Scanner/System.out in Java.

输入格式

The first line contains two integers $n$ and $k$ ( $1<=n<=10^{5}$ , $0<=k<=10^{6}$ ).

The second line contains a string $s$ of length $n$ , consisting of lowercase English letters.

输出格式

If there is no string satisfying the given conditions then print "-1" (without the quotes).

Otherwise, print any nice string $s'$ that ![](/uploads/acgo/image/1c988751be45ade1_c3e3057ac0e9.jpeg).

输入输出样例

输入 #1
4 26
bear
输出 #1
roar
输入 #2
2 7
af
输出 #2
db
输入 #3
3 1000
hey
输出 #3
-1
C++ 编辑器
输入
输出