{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"题目描述","value":{"format":"MD","content":"我们都知道数字与数字之间是如何进行除法运算的,但是 TXT 认为字符串之间也有相似的运算。\n\nTXT 定义当且仅当存在一个正整数 $x$,使得我们连续写出字符串 $a$ $x$ 次,我们得到字符串 $b$ 时,字符串 $a$ 是字符串 $b$ 的除数。例如,字符串 \"abab\" 有两个除数 \"ab\" 和 \"abab\"。\n\n现在 TXT 想写一个程序,计算两个字符串的公共除数的数量。请帮助他。"}},{"title":"输入格式","value":{"format":"MD","content":"第一行输入包含一个非空字符串 $s_1$。\n\n第二行输入包含一个非空字符串 $s_2$。\n\n字符串 $s_1$ 和 $s_2$ 的长度都是正数,且不超过 $10^5$ 。字符串只包含小写拉丁字母。"}},{"title":"输出格式","value":{"format":"MD","content":"打印字符串 $s_1$ 和 $s_2$ 的公共除数的数量。"}},{"title":"样例 #1","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eabcdabcd\nabcdabcdabcdabcd\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"样例 #2","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eaaa\naa\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"样例解释","value":{"format":"MD","content":"在第一个示例中,公共除数是字符串 \"abcd\" 和 \"abcdabcd\"。\n\n在第二个示例中,公共除数是单个字符串 \"a\"。字符串 \"aa\" 不包含在答案中,因为它不是字符串 \"aaa\" 的除数。"}}]}