C. Three Kinds of Dice
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
6 1 1 6 6 8 8
3 2 4 9
Output
0.291666667 0.750000000
Input
4 9 3 7 5
3 4 2 3
Output
0.500000000 0.500000000