Codeforces Round 122 (Div. 2)


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

Examples
Input
4 8
Output
4
Input
4 10
Output
2
Input
1 3
Output
0
----------------------------------------------------------------------------------------------------
B. Square
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
4 8 100
Output
17
33
401
----------------------------------------------------------------------------------------------------
C. Cutting Figure
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 4
####
#..#
#..#
#..#
####
Output
2
Input
5 5
#####
#...#
#####
#...#
#####
Output
2
----------------------------------------------------------------------------------------------------
D. Xor
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 2 1
7 7 7
8 8 8
1 2 3
1 3 2
Output
96
Input
2 1 0
1 1
1 1
1 -1
1 2
Output
0
----------------------------------------------------------------------------------------------------
E. Hamming Distance
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 4 4
4 4
4
Output
6
aaaabb
aabbaa
bbaaaa
bbbbbb
----------------------------------------------------------------------------------------------------
