Kotlin Heroes: Practice 9 (release 2)


A. Spy Detected!
time limit per test: 3.0 s
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
4
11 13 11 11
5
1 4 4 4 4
10
3 3 3 3 10 3 3 3 3 3
3
20 20 10
Output
2
1
5
3
----------------------------------------------------------------------------------------------------
B. Repeating Cipher
time limit per test: 3.0 s
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
baabbb
Output
bab
Input
10
ooopppssss
Output
oops
Input
1
z
Output
z
----------------------------------------------------------------------------------------------------
C. Teams Forming
time limit per test: 3.0 s
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
5 10 2 3 14 5
Output
5
Input
2
1 100
Output
99
----------------------------------------------------------------------------------------------------
D. Two Shuffled Sequences
time limit per test: 3.0 s
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
7 2 7 3 3 1 4
Output
YES
2
3 7 
5
7 4 3 2 1 
Input
5
4 3 1 5 3
Output
YES
1
3 
4
5 4 3 1 
Input
5
1 1 2 1 2
Output
NO
Input
5
0 1 2 3 4
Output
YES
0
5
4 3 2 1 0 
----------------------------------------------------------------------------------------------------
E. Powers Of Two
time limit per test: 3.0 s
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
9 4
Output
YES
1 2 2 4 
Input
8 1
Output
YES
8 
Input
5 1
Output
NO
Input
3 7
Output
NO
----------------------------------------------------------------------------------------------------
F. Boxers
time limit per test: 3.0 s
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
3 2 4 1
Output
4
Input
6
1 1 1 4 4 4
Output
5
----------------------------------------------------------------------------------------------------
G. Median String
time limit per test: 3.0 s
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
az
bf
Output
bc
Input
5
afogk
asdji
Output
alvuw
Input
6
nijfvj
tvqhwp
Output
qoztvz
----------------------------------------------------------------------------------------------------
H. Two Merged Sequences
time limit per test: 3.0 s
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
9
5 1 3 6 8 2 9 0 10
Output
YES
1 0 0 0 0 1 0 1 0 
Input
5
1 2 4 0 2
Output
NO
----------------------------------------------------------------------------------------------------
