D. Infinite LCS
time limit per test
1.5 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Consider two strings denoted by $$$s$$$ and $$$t$$$ of length $$$n$$$.

Define $$$f(a, b) = \frac{{\text{lcs}(a, b)}}{{|a| + |b|}}$$$, where $$$a$$$ and $$$b$$$ are strings, $$$\text{lcs}(a, b)$$$ represents the length of the longest common subsequence, and $$$|a|$$$ and $$$|b|$$$ are the respective lengths of strings $$$a$$$ and $$$b$$$.

Now, let $$$g(x, y) = f(\underbrace{s + \ldots + s}_{x\ \text{times}}, \underbrace{t + \ldots + t}_{y\ \text{times}})$$$, where $$$a + b$$$ denotes the concatenation of strings.

Find the maximal possible value of $$$g(x, y)$$$.

Input

The first line contains one integer $$$T$$$ — the number of test cases.

The first line of each test case contains an integer $$$n$$$ $$$(1 \le n \le 200)$$$ — the length of strings $$$s$$$ and $$$t$$$.

The second line contains one string $$$s$$$ of length $$$n$$$.

The third line contains one string $$$t$$$ of length $$$n$$$.

Both strings consist only of lowercase Latin letters.

It is guaranteed that the sum of $$$n^2$$$ over all test cases does not exceed $$$10^5$$$.

Output

For each test case, print the maximal possible value of $$$g(x, y)$$$. Your answer will be considered correct if its relative or absolute error does not exceed $$$10^{-9}$$$.

Example
Input
3
2
as
sa
3
acb
cab
7
qwdasdq
asdqaqw
Output
0.500000000000
0.333333333333
0.428571428571