Codeforces Round 784 (Div. 4)


A. Division?
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
-789
1299
1300
1399
1400
1679
2300
Output
Division 4
Division 4
Division 4
Division 4
Division 3
Division 2
Division 1
----------------------------------------------------------------------------------------------------
B. Triple
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
1
1
3
2 2 2
7
2 2 3 3 4 2 2
8
1 4 3 4 3 2 4 1
9
1 1 1 2 2 2 3 3 3
5
1 5 2 4 3
4
4 4 4 4
Output
-1
2
2
4
3
-1
4
----------------------------------------------------------------------------------------------------
C. Odd/Even Increments
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

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

Examples
Input
12
5
BRBBW
1
B
2
WB
2
RW
3
BRB
3
RBB
7
WWWWWWW
9
RBWBWRRBW
10
BRBRBRBRRB
12
BBBRWWRRRWBR
10
BRBRBRBRBW
5
RBWBW
Output
YES
NO
NO
NO
YES
YES
YES
NO
YES
NO
YES
NO
----------------------------------------------------------------------------------------------------
E. 2-Letter Strings
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
6
ab
cb
db
aa
cc
ef
7
aa
bb
cc
ac
ca
bb
aa
4
kk
kk
ab
ab
5
jf
jf
jk
jk
jk
Output
5
6
0
6
----------------------------------------------------------------------------------------------------
F. Eating Candies
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
3
10 20 10
6
2 1 4 2 4 1
5
1 2 4 8 16
9
7 3 20 5 15 1 11 8 10
Output
2
6
0
7
----------------------------------------------------------------------------------------------------
G. Fall Down
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
6 10
.*.*....*.
.*.......*
...o....o.
.*.*....*.
..........
.o......o*
2 9
...***ooo
.*o.*o.*o
5 5
*****
*....
*****
....*
*****
Output
..........
...*....*.
.*.o....o.
.*........
.*......**
.o.*....o*
....**ooo
.*o**o.*o
.....
*...*
*****
*****
*****
----------------------------------------------------------------------------------------------------
H. Maximal AND
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
3 2
2 1 1
7 0
4 6 6 28 6 6 12
1 30
0
4 4
3 1 3 1
Output
2
4
2147483646
1073741825
----------------------------------------------------------------------------------------------------
