K. Alea Iacta Est
time limit per test
10 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
5 8
ABCDEP
AEHOXU
AISOLR
ABCDEF
ABCSCC
PARSE
PAUSE
PHASE
POISE
PROSE
PULSE
PURSE
PEACE
Output
9.677887141
Input
2 1
AAAAAA
BBBBBB
AB
Output
1.000000000
Input
3 1
123456
123456
123456
666
Output
10.555444555
Input
2 1
ABCDEF
GHI234
AB
Output
impossible