Codeforces Round 467 (Div. 2)


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

Examples
Input
4
1 3 3 2
Output
3
Input
3
1 1 1
Output
1
Input
4
42 0 0 42
Output
1
----------------------------------------------------------------------------------------------------
B. Vile Grasshoppers
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 6
Output
5
Input
3 4
Output
-1
----------------------------------------------------------------------------------------------------
C. Save Energy!
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 2 6
Output
6.5
Input
4 2 20
Output
20.0
----------------------------------------------------------------------------------------------------
D. Sleepy Game
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 6
2 2 3
2 4 5
1 4
1 5
0
1
Output
Win
1 2 4 5 
Input
3 2
1 3
1 1
0
2
Output
Lose
Input
2 2
1 2
1 1
1
Output
Draw
----------------------------------------------------------------------------------------------------
E. Lock Puzzle
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
abacbb
babcba
Output
4
6 3 2 3
Input
3
aba
bba
Output
-1
----------------------------------------------------------------------------------------------------
