#K74137. Decoding Shifted Strings

    ID: 34131 Type: Default 1000ms 256MiB

Decoding Shifted Strings

Decoding Shifted Strings

You are given encoded strings that have been ciphered using a simple shift. In each test case, each letter of an encoded string is shifted to the right by a fixed number of positions, and your task is to recover the original string by shifting each character to the left by the same amount.

The decoding can be described by the formula: $$c' = ((c - \text{'a'} - s) \mod 26) + \text{'a'}$$ where \(c\) is the ASCII code of the encoded character, \(s\) is the shift value, and \(c'\) is the ASCII code of the decoded character.

The input is read from STDIN and the output should be printed to STDOUT.

inputFormat

The first line contains an integer (T), representing the number of test cases. Each of the following (T) lines contains an encoded string and an integer (s) separated by a space.

outputFormat

For each test case, print the decoded string on a new line.## sample

3
jgnnq 2
yqtnf 2
lipps 4
hello

world hello

</p>