ZeptoLab Code Rush 2015


A. King of Thieves
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
16
.**.*..*.***.**.
Output
yes
Input
11
.*.*...*.*.
Output
no
----------------------------------------------------------------------------------------------------
B. Om Nom and Dark Park
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
1 2 3 4 5 6
Output
5
----------------------------------------------------------------------------------------------------
C. Om Nom and Candies
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 3 5 2 3
Output
16
----------------------------------------------------------------------------------------------------
D. Om Nom and Necklace
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7 2
bcabcab
Output
0000011
Input
21 2
ababaababaababaababaa
Output
000110000111111000011
----------------------------------------------------------------------------------------------------
E. Transmitting Levels
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6 3
2 4 2 1 3 2
7
4
6
Output
2
4
3
----------------------------------------------------------------------------------------------------
F. Pudding Monsters
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
1 1
4 3
3 2
2 4
5 5
Output
10
----------------------------------------------------------------------------------------------------
G. Spiders Evil Plan
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6 3
1 2 2
2 3 2
3 4 2
4 6 1
3 5 10
3 1
2 5
1 1
Output
14
13
17
----------------------------------------------------------------------------------------------------
