Codeforces Round 691 (Div. 2)


A. Red-Blue Shuffle
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
3
3
777
111
3
314
159
5
09281
09281
Output
RED
BLUE
EQUAL
----------------------------------------------------------------------------------------------------
B. Move and Turn
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
1
Output
4
Input
2
Output
4
Input
3
Output
12
----------------------------------------------------------------------------------------------------
C. Row GCD
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4 4
1 25 121 169
1 2 7 23
Output
2 3 8 24
----------------------------------------------------------------------------------------------------
D. Glass Half Spilled
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
3
6 5
6 5
10 2
Output
7.0000000000 11.0000000000 12.0000000000
----------------------------------------------------------------------------------------------------
E. Latin Square
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
5
3 2
1 2 3
2 3 1
3 1 2
DR
3 2
1 2 3
2 3 1
3 1 2
LU
3 1
1 2 3
2 3 1
3 1 2
I
3 1
1 2 3
2 3 1
3 1 2
C
3 16
1 2 3
2 3 1
3 1 2
LDICRUCILDICRUCI
Output
2 3 1 
3 1 2 
1 2 3 
3 1 2 
1 2 3 
2 3 1 
1 2 3 
3 1 2 
2 3 1 
1 3 2 
2 1 3 
3 2 1 
2 3 1 
3 1 2 
1 2 3
----------------------------------------------------------------------------------------------------
F. Flip and Reverse
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
3
100101
1100011
10101010
Output
010110
0110110
10101010
----------------------------------------------------------------------------------------------------
