Codeforces Round 157 (Div. 2)


A. Little Elephant and Chess
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
WBWBWBWB
BWBWBWBW
BWBWBWBW
BWBWBWBW
WBWBWBWB
WBWBWBWB
BWBWBWBW
WBWBWBWB
Output
YES
Input
WBWBWBWB
WBWBWBWB
BBWBWWWB
BWBWBWBW
BWBWBWBW
BWBWBWWW
BWBWBWBW
BWBWBWBW
Output
NO
----------------------------------------------------------------------------------------------------
B. Little Elephant and Magic Square
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
0 1 1
1 0 1
1 1 0
Output
1 1 1
1 1 1
1 1 1
Input
0 3 6
5 0 5
4 7 0
Output
6 3 6
5 5 5
4 7 4
----------------------------------------------------------------------------------------------------
C. Little Elephant and Bits
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
101
Output
11
Input
110010
Output
11010
----------------------------------------------------------------------------------------------------
D. Little Elephant and Elections
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
Output
0
Input
8
Output
1440
----------------------------------------------------------------------------------------------------
E. Little Elephant and LCM
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 4 3 2
Output
15
Input
2
6 3
Output
13
----------------------------------------------------------------------------------------------------
