You are given two strings $S$ and $R$. Each of these strings has length $N$. We want to make $S$ equal to $R$ by performing the following operation some number of times (possibly zero):
- Choose two integers $a$ and $b$ such that $1 \le a \le b \le N$.
- For each $i$ such that $a \le i \le b$, replace the $i$-th character of $S$ by the $i$-th character of $R$.
Suppose that we make $S$ equal to $R$ by performing this operation $k$ times, in such a way that the total number of replaced characters (i.e. the sum of all $k$ values of $b-a+1$) is $l$. Then, the cost of this process is defined as $k \cdot l$.
Find the minimum cost with which we can make $S$ equal to $R$.

-----Input-----
- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
- The first line of each test case contains a single string $S$.
- The second line contains a single string $R$.

-----Output-----
For each test case, print a single line containing one integer ― the minimum cost.

-----Constraints-----
- $1 \le T \le 4,000$
- $1 \le N \le 10^6$
- $|S| = |R| = N$
- $S$ and $R$ contain only lowercase English letters
- the sum of $N$ over all test cases does not exceed $2 \cdot 10^6$

-----Example Input-----
1
adefb
bdefa

-----Example Output-----
4

-----Explanation-----
Example case 1: $S$ can be made equal to $R$ in two moves. First, we replace $S_1$ by $R_1$ and then replace $S_5$ by $R_5$. We have $k = l = 2$, so the cost is $2 \cdot 2 = 4$. If we wanted to perform only one operation, the cost would be $5$.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'try:\n from collections import Counter\n from sys import stdin, stdout\n def get_ints(): return map(int, stdin.readline().strip().split())\n def get_list(): return list(map(int, stdin.readline().strip().split()))\n def get_string(): return stdin.readline().strip()\n def get_singleInt(): return int(stdin.readline())\n def main():\n  testCases=get_singleInt()\n  for i in range(testCases):\n   stringA=get_string()\n   stringB=get_string()\n   minOperationsRequired(stringA,stringB)\n\n def minOperationsRequired(stringA,stringB):\n  #minL is positions where stringA[i]!=stringB[i]\n  minL=0\n  maxK=0\n  #gapsList that contains ranges where elements are equal\n  gapsList=[]\n  length=len(stringA)\n  #finding minL\n  for i in range(length):\n   if stringA[i]!=stringB[i]:\n    minL=minL+1\n  #A=abbbbaabb\n  #B=aaaaaaaaa\n  #finding maxK\n  flag=0\n  for i in range(length):\n   if stringA[i]!=stringB[i]:\n    if flag==0:\n     maxK=maxK+1\n    flag=1\n   else:\n    flag=0\n  #finding gapsList\n  fl=1\n  glE=0\n  for i in range(length):\n   if stringA[i]==stringB[i]:\n    if fl==0:\n     glE=glE+1\n   else:\n    if glE>0:\n     gapsList.append(glE)\n    fl=0\n    glE=0\n  gapsList=sorted(gapsList)\n  #Calculating minCost\n  minCost=minL*maxK\n  for i in range(len(gapsList)):\n   minL=minL+gapsList[i]\n   maxK=maxK-1\n   minCost=min(minCost,minL*maxK)\n  stdout.write(str(minCost)+"\\n")\n\n def __starting_point():\n  main()\n\nexcept Exception:\n pass\n__starting_point()'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 15279