Croc Champ 2013 - Round 2


A. Weird Game
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
0111
0001
Output
First
Input
3
110110
001001
Output
First
Input
3
111000
000111
Output
Draw
Input
4
01010110
00101101
Output
First
Input
4
01100000
10010011
Output
Second
----------------------------------------------------------------------------------------------------
B. Distinct Paths
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 2 4
0 0
0 0
Output
48
Input
2 2 4
1 2
2 1
Output
0
Input
5 6 10
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
Output
3628800
Input
2 6 10
1 2 3 4 5 6
0 0 0 0 0 0
Output
4096
----------------------------------------------------------------------------------------------------
C. Cube Problem
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
24
Output
1
Input
648
Output
7
Input
5
Output
0
Input
93163582512000
Output
39090
----------------------------------------------------------------------------------------------------
D. Ksusha and Square
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
0 0
5 5
5 0
Output
4.6666666667
Input
4
-1 3
4 5
6 2
3 -5
Output
8.1583333333
Input
3
17 136
859 937
16 641
Output
66811.3704155169
----------------------------------------------------------------------------------------------------
E. Close Vertices
time limit per test: 5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 4 6
1 3
1 4
1 3
Output
4
Input
6 2 17
1 3
2 5
2 13
1 6
5 9
Output
9
----------------------------------------------------------------------------------------------------
