Codeforces Round 721 (Div. 2)


A. And Then There Were K
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
2
5
17
Output
1
3
15
----------------------------------------------------------------------------------------------------
B1. Palindrome Game (easy version)
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
4
1001
1
0
Output
BOB
BOB
----------------------------------------------------------------------------------------------------
B2. Palindrome Game (hard version)
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
3
110
2
00
4
1010
Output
ALICE
BOB
ALICE
----------------------------------------------------------------------------------------------------
C. Sequence Pair Weight
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
4
1 2 1 1
4
1 2 3 4
Output
6
0
----------------------------------------------------------------------------------------------------
D. MEX Tree
time limit per test: 1.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
4
0 1
0 2
2 3
2
1 0
Output
1 2 1 1 1 
0 0 1 
----------------------------------------------------------------------------------------------------
E. Partition Game
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7 2
1 6 6 4 6 6 6
Output
3
Input
7 4
5 5 5 5 2 3 3
Output
1
----------------------------------------------------------------------------------------------------
