Codeforces Round 770 (Div. 2)


A. Reverse and Concatenate
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
3 2
aab
3 3
aab
7 1
abacaba
2 0
ab
Output
2
2
1
1
----------------------------------------------------------------------------------------------------
B. Fortune Telling
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 7 9
2
2 0 2
1 3
4 0 1
1 2 3 4
2 1000000000 3000000000
1000000000 1000000000
Output
Alice
Alice
Bob
Alice
----------------------------------------------------------------------------------------------------
C. OKEA
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 1
2 2
3 3
3 1
Output
YES
1 
YES
1 3 
2 4 
NO
YES
1 
2 
3 
----------------------------------------------------------------------------------------------------
D. Finding Zero
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
4
2
3
3
2
Output
? 1 2 3
? 2 3 4
? 3 4 1
? 4 1 2
! 2 3
----------------------------------------------------------------------------------------------------
E. Fair Share
time limit per test: 1.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
2
1 2
4
1 2 3 3
6
1 1 2 2 3 3
Output
YES
RL
LRLR
RLLRRL
----------------------------------------------------------------------------------------------------
F. Fibonacci Additions
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 5 3
2 2 1
0 0 0
A 1 3
A 1 3
B 1 1
B 2 2
A 3 3
Output
YES
NO
NO
NO
YES
Input
5 3 10
2 5 0 3 5
3 5 8 2 5
B 2 3
B 3 4
A 1 2
Output
NO
NO
YES
----------------------------------------------------------------------------------------------------
