Croc Champ 2013 - Qualification Round


A. Spyke Talks
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
0 1 7 1 7 10
Output
2
Input
3
1 1 1
Output
-1
Input
1
0
Output
0
----------------------------------------------------------------------------------------------------
B. Command Line Arguments
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
"RUn.exe O" "" "   2ne, " two! . " "
Output
<RUn.exe O>
<>
<   2ne, >
<two!>
<.>
< >
Input
   firstarg   second   ""    
Output
<firstarg>
<second>
<>
----------------------------------------------------------------------------------------------------
C. Network Mask
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 3
0.0.0.1
0.1.1.2
0.0.2.1
0.1.1.0
0.0.2.3
Output
255.255.254.0
Input
5 2
0.0.0.1
0.1.1.2
0.0.2.1
0.1.1.0
0.0.2.3
Output
255.255.0.0
Input
2 1
255.0.0.1
0.0.0.2
Output
-1
----------------------------------------------------------------------------------------------------
D. Parallel Programming
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 1
Output
1
Input
3 2
Output
2 3 3
3 3 3
----------------------------------------------------------------------------------------------------
E. Tree-String Problem
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
1 ab
5 bacaba
1 abacaba
2 aca
5 ba
2 ba
aba
Output
6
Input
7
1 ab
5 bacaba
1 abacaba
2 aca
5 ba
2 ba
bacaba
Output
4
----------------------------------------------------------------------------------------------------
