Codeforces Round 632 (Div. 2)


A. Little Artem
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
3 2
3 3
Output
BW
WB
BB
BWB
BWW
BWB
----------------------------------------------------------------------------------------------------
B. Kind Anton
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
3
1 -1 0
1 1 -2
3
0 1 1
0 2 2
2
1 0
1 41
2
-1 0
-1 -41
5
0 1 -1 1 -1
1 1 -1 1 -1
Output
YES
NO
YES
YES
NO
----------------------------------------------------------------------------------------------------
C. Eugene and an array
time limit per test: 1.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2 -3
Output
5
Input
3
41 -41 41
Output
3
----------------------------------------------------------------------------------------------------
D. Challenges in school №41
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 1
RL
Output
1 1 
Input
2 1
LR
Output
-1
Input
4 2
RLRL
Output
2 1 3 
1 2
----------------------------------------------------------------------------------------------------
E. Road to 1600
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
Output
-1
Input
4
Output
4 3 6 12 
7 5 9 15 
14 1 11 10 
13 8 16 2 
----------------------------------------------------------------------------------------------------
F. Kate and imperfection
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
Output
1 
Input
3
Output
1 1 
----------------------------------------------------------------------------------------------------
