Codeforces Beta Round 78 (Div. 1 Only)


A. Help Victoria the Wise
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
YYYYYY
Output
1
Input
BOOOOB
Output
2
Input
ROYGBV
Output
30
----------------------------------------------------------------------------------------------------
B. Help King
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
Output
1/1
Input
3
Output
8/3
Input
4
Output
2/1
----------------------------------------------------------------------------------------------------
C. Help Greg the Dwarf
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 2 1
Output
1.0000000
Input
2 2 2
Output
2.0000000
Input
2 2 3
Output
1.3284271
Input
2 2 6
Output
My poor head =(
----------------------------------------------------------------------------------------------------
D. Help Monks
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
3 2 1
Output
7
1 3
1 2
3 2
1 3
2 1
2 3
1 3
Input
3
3 1 1
Output
5
1 2
1 2
1 3
2 3
2 3
Input
3
3 3 3
Output
5
1 2
1 2
1 3
2 3
2 3
----------------------------------------------------------------------------------------------------
E. Help Shrek and Donkey
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
0 3
Output
0.25 0.75
Input
1 0
Output
1 0
Input
1 1
Output
0.5 0.5
----------------------------------------------------------------------------------------------------
