Codeforces Beta Round 95 (Div. 2)


A. cAPS lOCK
time limit per test: 0.5 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
cAPS
Output
Caps
Input
Lock
Output
Lock
----------------------------------------------------------------------------------------------------
B. Opposites Attract
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
-3 3 0 0 3
Output
3
Input
3
0 0 0
Output
3
----------------------------------------------------------------------------------------------------
C. The World is a Theatre
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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

Examples
Input
4
1 3
4 3
4 2
1 2
Output
0 0 0 0 
Input
6
1 2
3 4
6 4
2 3
1 3
3 5
Output
0 0 0 1 1 2 
----------------------------------------------------------------------------------------------------
E. Yet Another Task with Queens
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
8 4
4 3
4 8
6 5
1 6
Output
0 3 0 1 0 0 0 0 0 
Input
10 3
1 1
1 2
1 3
Output
0 2 1 0 0 0 0 0 0 
----------------------------------------------------------------------------------------------------
F. Present to Mom
time limit per test: 5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 6 2
111000
111100
011011
000111
Output
6
Input
5 5 4
11111
11111
11111
11111
11111
Output
9
----------------------------------------------------------------------------------------------------
