2019-2020 ICPC, NERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams Preferred)


B. Balls of Buma
time limit per test: 3 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
BBWWBB
Output
3
Input
BWWB
Output
0
Input
BBWBB
Output
0
Input
OOOWWW
Output
0
Input
WWWOOOOOOWWW
Output
7
----------------------------------------------------------------------------------------------------
D. DevOps Best Practices
time limit per test: 3 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
3
1 1 1
1 0 1
1 1 1
1 1 1
0 0 0
1 0 1
Output
Possible
1 1 1
2
3 2
1 3
Input
2
1 1 1
0 0 1
1 1 1
1 1 0
Output
Impossible
----------------------------------------------------------------------------------------------------
E. Elections
time limit per test: 3 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
5 3
6 3 4 2 8
3 7 5 6 7
5 2 4 7 9
Output
2
3 1 
Input
2 1
1 1
Output
0
Input
3 3
2 3 8
4 2 9
3 1 7
Output
3
1 2 3 
----------------------------------------------------------------------------------------------------
G. Game Relics
time limit per test: 3 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
2 20
25 100
Output
47.50000000000000000
Input
4 30
60 50 60 80
Output
171.25000000000000000
----------------------------------------------------------------------------------------------------
H. Help BerLine
time limit per test: 5 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
5
3
1 3 2
3
1 2 3
1
1
10
6 10 4 2 7 9 5 8 3 1
10
2 4 6 9 1 8 10 5 3 7
Output
1 3 2 
10 20 10
1 
2 3 4 5 3 1 3 5 4 2 
1 2 3 4 5 6 7 8 9 10
----------------------------------------------------------------------------------------------------
I. Intriguing Selection
time limit per test: 5 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
2
3
>
<
>
<
>
>
3
<
<
<
>
>
Output
? 1 3
? 4 2
? 4 5
? 6 5
? 3 4
? 5 6
!
? 3 4
? 4 2
? 5 3
? 6 4
? 3 1
!
----------------------------------------------------------------------------------------------------
J. Just Arrange the Icons
time limit per test: 5 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
3
11
1 5 1 5 1 5 1 1 1 1 5
6
1 2 2 2 2 1
5
4 3 3 1 2
Output
3
3
4
----------------------------------------------------------------------------------------------------
K. Key Storage
time limit per test: 3 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
3
1
11
123456
Output
0
1
127
----------------------------------------------------------------------------------------------------
L. Lexicography
time limit per test: 3 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
3 2 2
abcdef
Output
af
bc
ed
Input
2 3 1
abcabc
Output
aab
bcc
----------------------------------------------------------------------------------------------------
