Codeforces Round 110 (Div. 1)


A. Message
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
aaaaa
aaa
Output
0
Input
abcabc
bcd
Output
1
Input
abcdef
klmnopq
Output
7
----------------------------------------------------------------------------------------------------
B. Suspects
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 1
+1
Output
Truth
Input
3 2
-1
-2
-3
Output
Not defined
Not defined
Not defined
Input
4 1
+2
-3
+4
-1
Output
Lie
Not defined
Lie
Not defined
----------------------------------------------------------------------------------------------------
C. Cipher
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
ab
Output
1
Input
1
aaaaaaaaaaa
Output
0
Input
2
ya
klmbfxzb
Output
24
320092793
----------------------------------------------------------------------------------------------------
D. Clues
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 0 1000000000
Output
1
Input
3 0 100
Output
3
Input
4 1 1000000000
1 4
Output
8
----------------------------------------------------------------------------------------------------
E. Mrs. Hudson's Pancakes
time limit per test: 5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
1
1
2 ? 1
Output
2
Input
4
2 3 5 7
4
2 ?0 11
2 ?1 13
2 0? 17
2 1? 19
Output
3
2
23
2
Input
1
1000000000000000000
1
16 ?????????????? 1
Output
-1
----------------------------------------------------------------------------------------------------
