{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eMZL\u0027s Circle Zhou is good at solving some counting problems. One day, he comes up with a counting problem:\u003cbr\u003eYou are given two strings $a,b$ which consist of only lowercase English letters. You can subtract a substring $x$ (maybe empty) from string $a$ and a substring $y$ (also maybe empty) from string $b$, and then connect them as $x+y$ with $x$ at the front and $y$ at the back. In this way, a series of new strings can be obtained.\u003cbr\u003eThe question is how many different new strings can be obtained in this way.\u003cbr\u003eTwo strings are different, if and only if they have different lengths or there exists an integer $i$ such that the two strings have different characters at position $i$.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line of the input is a single integer $T~(T≤5)$, indicating the number of testcases. \u003cbr\u003eFor each test case, there are two lines, the first line is string $a$, and the second line is string $b$. $1\u0026lt;\u003d|a|,|b|\u0026lt;\u003d90000$."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output one line, a single integer indicating the answer."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\nacbcc\r\ncccabc\r\nbbbabbababbababbaaaabbbbabbaaaabaabbabbabbbaaabaab\r\nabbaabbabbaaaabbbaababbabbabababaaaaabbaabbaabbaab\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e135\r\n557539\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}