Croc Champ 2012 - Round 2 (Unofficial Div. 2 Edition)


A. Series of Crimes
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 2
.*
..
**
Output
1 1
Input
3 3
*.*
*..
...
Output
2 3
----------------------------------------------------------------------------------------------------
B. Number of Triplets
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 1
2 2
3 3
Output
1
Input
3
0 0
-1 0
0 1
Output
0
----------------------------------------------------------------------------------------------------
C. Trading Business
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 3 10
Venus
6 5 3
7 6 5
8 6 10
Earth
10 9 0
8 6 4
10 9 3
Mars
4 3 0
8 4 12
7 2 5
Output
16
----------------------------------------------------------------------------------------------------
D. Word Cut
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
ab
ab
2
Output
1
Input
ababab
ababab
1
Output
2
Input
ab
ba
2
Output
0
----------------------------------------------------------------------------------------------------
E. Playing with Superglue
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 6 1 2 1 6
Output
First
Input
6 5 4 3 2 1
Output
First
Input
10 10 1 1 10 10
Output
Second
----------------------------------------------------------------------------------------------------
