Codeforces Beta Round 96 (Div. 1)


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

Examples
Input
Hello, World!
Output
238
108
112
0
64
194
48
26
244
168
24
16
162
----------------------------------------------------------------------------------------------------
B. Piet
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 10
12
43
Output
1
Input
3 12
1423
6624
6625
Output
6
Input
5 9
10345
23456
34567
45678
56789
Output
5
----------------------------------------------------------------------------------------------------
C. Logo Turtle
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
FT
1
Output
2
Input
FFFTFFF
2
Output
6
----------------------------------------------------------------------------------------------------
D. Constants in the language of Shakespeare
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1111
Output
2
+2^4
-2^0
Input
1010011
Output
4
+2^0
+2^1
+2^4
+2^6
----------------------------------------------------------------------------------------------------
E. Bits of merry old England
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7 2
1 2 2 4 2 1 2
Output
11 4
b=1
print(b)
a=2
print(a)
print(a)
b=4
print(b)
print(a)
b=1
print(b)
print(a)
Input
6 3
1 2 3 1 2 3
Output
9 4
c=1
print(c)
b=2
print(b)
a=3
print(a)
print(c)
print(b)
print(a)
----------------------------------------------------------------------------------------------------
