Cryptoquote 0 ]- k6 x) K2 s' g a6 K! j 3 S% G9 {. W+ ^( G ) g8 f* C( z$ S3 D, i) x3 Z% C3 bTime Limit: 1000 ms Memory Limit: 65536 kB4 ^5 p' F( ]+ c. K" M
Solved: 79 Tried: 281 ' W% e+ x. @" g1 ^( S# c0 s* Q5 S$ t. h4 `; Y( T1 ?/ E) S
Description 2 v* M; Z! K( c9 h* D( |
A cryptoquote is a ** encoded message where one letter is simply replaced by another throughout the message. For example: / j3 m5 X) a/ p }' q & g# m1 ]1 {' G5 Z# ^: ?- a* BEncoded: HPC PJVYMIY 6 N8 V& Y$ u) A0 _. ?; @
Decoded: ACM CONTEST 4 ], e9 M; D" G4 |! O - J$ l: R: n2 V1 d4 W2 u0 KIn the example above, H=A, P=C, C=M, J=O, V=N, Y=T, M=E and I=S. For this problem, you will decode messages. ( F0 e* @5 n1 t5 ?- @3 P5 G( K X4 q% o
7 s0 K& n. ^" ?+ NInput $ s R- V! L3 O, v. ^: K5 gThe first line of input contains a single integer N,(1<=N<=1000) which is the number of data sets that follow. Each data set consists of two lines of input. The first line is the encoded message. The second line is a 26 character string of upper case letters giving the character mapping for each letter of the alphabet: the first character gives the mapping for A, the second for B and so on. Only upper case letters will be used. Spaces may appear in the encoded message, and should be preserved in the output string.0 o0 k8 o" a1 s( l7 T' D7 B4 [
( S+ J6 F# D8 J+ ]1 u/ u
% r: ?. l& C; x5 E* M
c. ]2 X m6 h" v
Output $ m7 g' H, i/ s& ]& ]For each data set, you should generate one line of output with the following values: The data set number as a decimal integer (start counting at one), a space and the decoded message. 8 F# o; z6 \+ R5 I- ^