407143: GYM102697 114 Viginere Cipher

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

114. Viginere Ciphertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

So I think the title explains it. Encrypt a given phrase using the vigenere cipher with a key that will be provided. The vigenere cipher is actually quite easy to use, just look at the image below. The left side is where the plain text characters go and the top is where the key letters go. The first letter of the plain text goes with the first letter of the key and all you do is draw a line across for the plain letter and a line down for the key letter. Where the two lines intersect is the new encrypted letter. Then you pair the second letter of the plain text with the second letter of the key and so on. Once you have reach the last letter of the key, you just go to the start of the key again. Also don't encrypt spaces, so just skip over them.

Input

The first line will be the plain text and the second line will be the key.

Output

Print the newly encrypted text.

ExampleInput
Here is an example test case
fish
Output
Mmjl na su jfstutw ajal jfaw

加入题单

算法标签: