Codeforces Round 486 (Div. 3)


A. Diverse Team
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 3
15 13 15 15 12
Output
YES
1 2 5 
Input
5 4
15 13 15 15 12
Output
NO
Input
4 4
20 10 40 30
Output
YES
1 2 3 4 
----------------------------------------------------------------------------------------------------
B. Substrings Sort
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
a
aba
abacaba
ba
aba
Output
YES
a
ba
aba
aba
abacaba
Input
5
a
abacaba
ba
aba
abab
Output
NO
Input
3
qwerty
qwerty
qwerty
Output
YES
qwerty
qwerty
qwerty
----------------------------------------------------------------------------------------------------
C. Equal Sums
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
5
2 3 1 3 2
6
1 1 2 2 2 1
Output
YES
2 6
1 2
Input
3
1
5
5
1 1 1 1 1
2
2 3
Output
NO
Input
4
6
2 2 2 2 2 2
5
2 2 2 2 2
3
2 2 2
5
2 2 2 2 2
Output
YES
2 2
4 1
----------------------------------------------------------------------------------------------------
D. Points and Powers of Two
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
3 5 4 7 10 12
Output
3
7 3 5
Input
5
-1 2 5 8 11
Output
1
8
----------------------------------------------------------------------------------------------------
E. Divisibility by 25
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5071
Output
4
Input
705
Output
1
Input
1241367
Output
-1
----------------------------------------------------------------------------------------------------
F. Rain and Umbrellas
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 2 4
3 7
8 10
0 10
3 4
8 1
1 2
Output
14
Input
10 1 1
0 9
0 5
Output
45
Input
10 1 1
0 9
1 5
Output
-1
----------------------------------------------------------------------------------------------------
