VK Cup 2017 - Wild Card Round 1 (Unofficial Public Mirror)


A. Amusement Park
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 4 1
011
Output
8
Input
4 7 2
1101
Output
18
----------------------------------------------------------------------------------------------------
B. Significant Cups
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 1 8
4 2
5 5
4 2
3 2
Output
8
Input
4 3 12
3 4
2 4
3 5
3 4
3 5
5 2
3 4
Output
11
Input
2 2 2
5 3
6 3
4 2
8 1
Output
0
----------------------------------------------------------------------------------------------------
C. Maximum Number
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
7
----------------------------------------------------------------------------------------------------
D. Lie or Truth
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 2 4
3 4 2 3 1
3 2 3 4 1
Output
TRUTH
Input
3 1 2
1 2 3
3 1 2
Output
LIE
Input
4 2 4
1 1 1 1
1 1 1 1
Output
TRUTH
----------------------------------------------------------------------------------------------------
E. Big Number and Remainder
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
521
3
Output
2
Input
1001
5
Output
0
Input
5678901234567890123456789
10000
Output
123
----------------------------------------------------------------------------------------------------
F. Pens And Days Of Week
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
3 3 3
Output
2
Input
5
5 4 5 4 4
Output
5
----------------------------------------------------------------------------------------------------
G. Perfectionist Arkadiy
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 18 13
Output
0.5
Input
4 4 4
Output
0
Input
3 4 3
Output
-1
----------------------------------------------------------------------------------------------------
H. Repairing Of String
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
6 3 1 0 0 0
Output
kkrrrq
Input
4
4 0 0 0
Output
abcd
----------------------------------------------------------------------------------------------------
I. Composing Of String
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
a
aa
a
aaa
Output
2
Input
4
ab
aab
aa
bb
baaab
Output
3
Input
2
aaa
bbb
aaacbbb
Output
-1
----------------------------------------------------------------------------------------------------
J. Stepan's Series
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 2
NYNNY
Output
YES
Input
6 1
????NN
Output
NO
----------------------------------------------------------------------------------------------------
K. Stepan and Vowels
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
13
pobeeeedaaaaa
Output
pobeda
Input
22
iiiimpleeemeentatiioon
Output
implemeentatioon
Input
18
aeiouyaaeeiioouuyy
Output
aeiouyaeeioouy
Input
24
aaaoooiiiuuuyyyeeeggghhh
Output
aoiuyeggghhh
----------------------------------------------------------------------------------------------------
L. Bars
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 3
010
Output
1
Input
8 3
01010110
Output
3
----------------------------------------------------------------------------------------------------
