OpenKattis
Skånemästerskapen 2016

Start

2016-01-30 09:30 CET

Skånemästerskapen 2016

End

2016-01-30 14:30 CET
The end is near!
Contest is over.
Not yet started.
Contest is starting in -3218 days 4:14:19

Time elapsed

5:00:00

Time remaining

0:00:00

Problem A
Känd klartext

När Alice skickar email med sin vän Bob så krypterar hon all text så att inte obehöriga kan läsa den. Totalt använder Alice och Bob fem olika chiffer för att kryptera sina mail.

Din uppgift är att, givet ett krypterat email och vilket chiffer som användes för att kryptera mailet, skriva ut emailet i klartext. Med klartext menas emailet som det såg ut innan det krypterades.

Till din hjälp får du för varje chiffer ett antal krypterade email och deras klartext.

Indata

Indata består först av ett tecken 1, 2, 3, 4 eller 5 - vilket chiffer som användes för att kryptera emailet. Talet är följt av ett mellanslag, och avslutas med det krypterade emailet på en rad.

Output

Du ska skriva ut klartexten för det krypterade mailet.

Poäng

  1. ditt program ska klara av det första chiffret.

  2. ditt program ska klara av det andra chiffret.

  3. ditt program ska klara av det tredje chiffret.

  4. ditt program ska klara av det fjärde chiffret.

  5. ditt program ska klara av det femte chiffret.

Sample Input 1 Sample Output 1
1 19-aqxsmeakkd
tjqlfxtddw
Sample Input 2 Sample Output 2
1 10-clitu
mvsde
Sample Input 3 Sample Output 3
1 21-tfpkp
oakfk
Sample Input 4 Sample Output 4
2 oowysruoqxylxyq
oloxwyyqsxryuqo
Sample Input 5 Sample Output 5
2 xpfmteiggqcxquf
xxpqfcmftqeuigg
Sample Input 6 Sample Output 6
2 txypu
tuxpy
Sample Input 7 Sample Output 7
2 jxwripcv
jcxpwvri
Sample Input 8 Sample Output 8
2 ukhazdnkbyevzw
uekvhyawzbdznk
Sample Input 9 Sample Output 9
3 cbdcbccbbbddbcbbbbaccbcda
abcbbbcbbcdbacccdbbdcbbdc
Sample Input 10 Sample Output 10
3 ccbddaaabcbdbdabbacddbbba
cbdabbacaabbabdddabbdcdbc
Sample Input 11 Sample Output 11
3 acccbbdcdacacbddcadddadca
dcdadddacbcaaddbadccccbca
Sample Input 12 Sample Output 12
3 dacabdbbccadbddbcacaddcad
ccaabcbcbdaddcddddbaaabcd
Sample Input 13 Sample Output 13
3 dddcdccadbbcbababbbabdcab
bbabadcbacadbcbacbbbcdddd
Sample Input 14 Sample Output 14
3 daabcdaabdbbcbdbbccbdaddc
cbbcbbadaddacddbbdcbbacad
Sample Input 15 Sample Output 15
3 bbcdabcabaadbdaccaccdcabb
cccacbcaabbcbadddabadbacb
Sample Input 16 Sample Output 16
3 dacacaaacaacabdcdaccbcaca
cdcaccaaaaccaabbcdaaaaccd
Sample Input 17 Sample Output 17
3 abaabdcabddbccbbbbabbacbd
abbbbbcdadbadcbcbbcdabbaa
Sample Input 18 Sample Output 18
4 isqlervn
nvrelqsi
Sample Input 19 Sample Output 19
4 vhugnzlvoehjl
gnzvhulhjlvoe
Sample Input 20 Sample Output 20
4 ch
hc
Sample Input 21 Sample Output 21
4 lv
vl
Sample Input 22 Sample Output 22
4 ycbupwaew
ubcypweaw
Sample Input 23 Sample Output 23
4 nzbmzdo
nzbmzdo
Sample Input 24 Sample Output 24
4 esuqzyluymznzny
esuqzyluymznzny
Sample Input 25 Sample Output 25
4 dsjuck
uckdsj
Sample Input 26 Sample Output 26
4 khrvaooowdjehnq
khrvaooowdjehnq
Sample Input 27 Sample Output 27
4 f
f
Sample Input 28 Sample Output 28
4 upaui
puaiu
Sample Input 29 Sample Output 29
4 dvfbngyidftghz
idftghzdvfbngy
Sample Input 30 Sample Output 30
4 auaimqkt
tkqmiaua
Sample Input 31 Sample Output 31
5 011100101011011111010101000
ehmgu
Sample Input 32 Sample Output 32
5 0111101000111011110011110111001
msfiqp
Sample Input 33 Sample Output 33
5 110000111111011110000001011110110101110100
omxadxhn
Sample Input 34 Sample Output 34
5 0000001110010110
zzit
Sample Input 35 Sample Output 35
5 0010111110110011110111000
dqvqo
Sample Input 36 Sample Output 36
5 001010010110010101001010101010110110
clcvkht
Sample Input 37 Sample Output 37
5 000000100010011000100111101001010001010
zzuvuvqcc
Sample Input 38 Sample Output 38
5 01110011100000010110110010101101110100100
eadtkxxj
Sample Input 39 Sample Output 39
5 1000001101010110110100
urkxn
Sample Input 40 Sample Output 40
5 1010011001001001000101010011100111000011000101000110
npjugeaont
Sample Input 41 Sample Output 41
5 11100111100000110010100010101001100110101001001101
iatkcvvgsx
Sample Input 42 Sample Output 42
5 10011011111001101010
vwig
Sample Input 43 Sample Output 43
5 11100010010100010011001
bcjp
Sample Input 44 Sample Output 44
5 101011101011111000010110010010110100000011100101010
hhawjwszeg
Sample Input 45 Sample Output 45
5 101000011111100100001101110001010
nryjrek
Sample Input 46 Sample Output 46
5 111000101010001010001000011001010
bkcjrc
Sample Input 47 Sample Output 47
5 1010101001000101011111000111101110010001111
gvzhbqpzy
Sample Input 48 Sample Output 48
5 1110100101011010111000001110001001011
qcxezbd
Sample Input 49 Sample Output 49
5 101001000001111100001100011100000111011101110001001
nuraoafxov
Sample Input 50 Sample Output 50
5 10101101010111010101110100
hkqln
Sample Input 51 Sample Output 51
5 10100010111110101000100011100101110111111
nlqssewwy
Sample Input 52 Sample Output 52
5 1010111100000011100010101100101110100001011
hozbldnd
Sample Input 53 Sample Output 53
5 1110011010111110111100110100
ihqin
Sample Input 54 Sample Output 54
5 1000010000011100001100010101111101111000101001111
uszaohqbsy
Sample Input 55 Sample Output 55
5 101010100000100010100010101111101100100101011
gujkcywjh
Sample Input 56 Sample Output 56
5 1000100101001010111010101010100110
uvshggt
Sample Input 57 Sample Output 57
5 1000011100110111101
uexq
Sample Input 58 Sample Output 58
5 01111100101110010111010111111
mvewhy
Sample Input 59 Sample Output 59
5 101010001000111011010011001
gjfnp
Sample Input 60 Sample Output 60
5 01010011101001111001010001111001010
kfrpsmc
Sample Input 61 Sample Output 61
5 011110100011100001011100110100001001011101011000
msedvnjwhz
Sample Input 62 Sample Output 62
5 11100001010011001010001010
anpsk
Sample Input 63 Sample Output 63
5 0111010010111101010101001001010000011100000011101
fdxkvczezf