Task:
You are given two strings S1 and S2 that can contain any ASCII symbols, except for the line feed character.
Normalize the strings: delete all symbols that are not latin letters, digits or a whitespace character, and decapitalize every letter (make it lowercase). You should then delete all words which length is less or equal to 3 and all extra whitespace characters (so that there's no more than one whitespace character between two words).
For the resulting strings count the following value: c / (|S1| + |S2| - c), where c is the number of matching symbols between the strings S1 and S2 and |Sn| is the length of the n-th string.
Input:
Two strings S1 and S2 separated with a line feed character.
Output:
The calculated value with at least 10-6 accuracy.
Example:
Input |
Output |
L8Q4EJv"J,6696 7 3AK.&+&'42a o S |
0.030303030303030303871 |