Codeforces Beta Round 48


A. Cheaterius's Problem
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
31
23
**
31
23
**
13
32
**
32
13
Output
1
Input
4
51
26
**
54
35
**
25
61
**
45
53
Output
2
----------------------------------------------------------------------------------------------------
B. bHTML Tables Analisys
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
<table><tr><td></td></tr></table>
Output
1 
Input
<table>
<tr>
<td>
<table><tr><td></td></tr><tr><td></
td
></tr><tr
><td></td></tr><tr><td></td></tr></table>
</td>
</tr>
</table>
Output
1 4 
Input
<table><tr><td>
<table><tr><td>
<table><tr><td>
<table><tr><td></td><td></td>
</tr><tr><td></td></tr></table>
</td></tr></table>
</td></tr></table>
</td></tr></table>
Output
1 1 1 3 
----------------------------------------------------------------------------------------------------
C. Three Base Stations
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 2 3 4
Output
0.500000
1.500000 2.500000 3.500000
Input
3
10 20 30
Output
0
10.000000 20.000000 30.000000
Input
5
10003 10004 10001 10002 1
Output
0.500000
1.000000 10001.500000 10003.500000
----------------------------------------------------------------------------------------------------
D. Geometrical problem
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
3 6 12 24
Output
0
Input
4
-8 -16 24 -32
Output
1
Input
4
0 1 2 3
Output
2
----------------------------------------------------------------------------------------------------
E. Pentagon
time limit per test: 10 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 5
1 2
2 3
3 4
4 5
5 1
Output
1
Input
5 10
1 2
1 3
1 4
1 5
2 3
2 4
2 5
3 4
3 5
4 5
Output
12
----------------------------------------------------------------------------------------------------
F. Caterpillar
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 4
1 2
2 3
3 4
4 2
Output
2
Input
6 3
1 2
3 4
5 6
Output
2
Input
7 6
1 2
2 3
1 4
4 5
1 6
6 7
Output
1
----------------------------------------------------------------------------------------------------
